2024-11-21 16:23:55 +02:00
# Setting up LiveKit (optional)
2024-10-02 13:27:02 +10:00
2024-11-21 16:24:05 +02:00
The playbook can install and configure [LiveKit ](https://github.com/livekit/livekit ) for you.
2024-10-02 13:27:02 +10:00
LiveKit is an open source project that provides scalable, multi-user conferencing based on WebRTC. It's designed to provide everything you need to build real-time video audio data capabilities in your applications.
See the project's [documentation ](https://github.com/livekit/livekit ) to learn more.
## Decide on a domain and path
2024-11-21 16:24:15 +02:00
By default, LiveKit is configured to be served on the Matrix domain (`sfu.example.com` , controlled by the `matrix_livekit_server_hostname` variable).
2024-10-02 13:27:02 +10:00
This makes it easy to set it up, **without** having to adjust your DNS records manually.
If you'd like to run Livekit on another hostname or path, use the `matrix_livekit_server_hostname` variable.
## Adjusting DNS records
If you've changed the default hostname, **you may need to adjust your DNS** records accordingly to point to the correct server.
Ensure that the following DNS names have a public IP/FQDN:
2024-11-21 16:24:26 +02:00
- `sfu.example.com`
2024-10-02 13:27:02 +10:00
## Adjusting the playbook configuration
Add the following configuration to your `inventory/host_vars/matrix.DOMAIN/vars.yml` file:
```yaml
matrix_livekit_server_enabled: true
2024-11-21 16:23:47 +02:00
2024-10-02 13:27:02 +10:00
# Set a secure key for LiveKit authentication
matrix_element_call_livekit_dev_key: 'your-secure-livekit-key'
## Installing
2024-11-21 16:23:36 +02:00
After configuring the playbook and potentially [adjusting your DNS records ](#adjusting-dns-records ), run the [installation ](installing.md ) command: `just install-all` or `just setup-all`
2024-10-02 13:27:02 +10:00
## Usage
2024-10-03 12:38:34 +10:00
Once installed, and in conjunction with Element Call and JWT Service, Livekit will become the WebRTC backend for all Element client calls.
2024-10-02 13:27:02 +10:00
## Required Firewall and Port Forwarding Rules
To ensure the services function correctly, the following firewall rules and port forwarding settings are required:
LiveKit:
• Forward UDP ports 50100:50200 to the Docker instance running LiveKit.
• Forward TCP port 7881 to the Docker instance running LiveKit.
Ensure these ports are open and forwarded appropriately to allow traffic to flow correctly between the services.
## Additional Information
Refer to the Livekit documentation for more details on configuring and using Livekit.