Skip to content

Latest commit

 

History

History
94 lines (61 loc) · 4.33 KB

configuring-livekit-server.md

File metadata and controls

94 lines (61 loc) · 4.33 KB

Setting up LiveKit Server

This is an Ansible role which installs LiveKit Server to run as a Docker container wrapped in a systemd service.

LiveKit is an open source platform for developers building realtime media applications. It makes it easy to integrate audio, video, text, data, and AI models while offering scalable realtime infrastructure built on top of WebRTC.

Refer: https://docs.livekit.io/home/get-started/intro-to-livekit/

Prerequisites

Adjusting firewall rules

To ensure LiveKit Server functions correctly, the following firewall rules and port forwarding settings are required:

  • 7881/tcp: ICE/TCP
  • 7882/udp: ICE/UDP Mux

💡 The suggestions above are inspired by the upstream Ports and Firewall documentation based on how LiveKit is configured in the playbook. If you've using custom configuration for the LiveKit Server role, you may need to adjust the firewall rules accordingly.

Adjusting the playbook configuration

To enable LiveKit Server with this role, add the following configuration to your vars.yml file.

Notes: if you use the matrix-docker-ansible-deploy (MDAD) Ansible playbook, you do not need to enable LiveKit Server explicitly as it is automatically enabled when Element Call is enabled.

########################################################################
#                                                                      #
# livekit-server                                                       #
#                                                                      #
########################################################################

livekit_server_enabled: true

########################################################################
#                                                                      #
# /livekit-server                                                      #
#                                                                      #
########################################################################

Set the hostname

To serve LiveKit Server you need to set the hostname as well. To do so, add the following configuration to your vars.yml file. Make sure to replace example.com with your own value.

livekit_server_hostname: "example.com"

Set the key

You also would probably wish to add at least one key to the livekit_server_config_keys_custom variable.

To add your own key, add the following configuration to your vars.yml file (adapt to your needs).

livekit_server_config_keys_custom:
  key1: secret1
  key2: secret2

Note: on the MDAD playbook, the key value is specified with livekit_server_config_keys_auto by default, so you do not need to add them. See its matrix_servers for details.

Installing

After configuring the playbook, run the installation command of your playbook as below:

ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start

If you use the MDAD Ansible playbook, the shortcut commands with the just program are also available: just install-all or just setup-all

Troubleshooting

You can find the logs in systemd-journald by logging in to the server with SSH and running journalctl -fu livekit-server (or how you/your playbook named the service, e.g. matrix-livekit-server).

Increase logging verbosity

The default logging level for this component is info. If you want to increase the verbosity, add the following configuration to your vars.yml file and re-run the playbook:

# Valid values: debug, info, warn, error
livekit_server_config_logging_level: "debug"