Voice servers
Every Squad instance comes with one LiveKit voice server inside it. You can add more, near people elsewhere or on machines with spare CPU and bandwidth.
Plain LiveKit
Заголовок раздела «Plain LiveKit»A voice server is plain LiveKit with a config Squad writes. Run one of these commands where Squad runs. It registers the server with your instance and prints its LiveKit config.
docker exec fluxer fluxerd voice-config --endpoint wss://voice.example.com > livekit.yamlrunuser -u fluxer -- /opt/fluxer/current/bin/fluxerd voice-config --endpoint wss://voice.example.com > livekit.yamlkubectl -n fluxer exec fluxer-0 -- fluxerd voice-config --endpoint wss://voice.example.com > livekit.yamlrexctl voice add --print --endpoint wss://voice.example.com > livekit.yaml| Flag | What it sets |
|---|---|
--endpoint | The address people’s apps open, which needs a certificate |
--tcp-port, --udp-port | Other media ports than 7881/tcp and 7882/udp |
--ip | The public IPv4 address LiveKit gives to apps |
--region | The voice region of the server |
--id | The server ID. A registered server’s ID prints a new config for it with a new secret |
--soft-limit | The connection count after which calls prefer other servers |
--lat, --long | The server’s location, both together |
Keep the config private, because it has the server’s key and secret. It also tells LiveKit to send its events to your Squad instance.
Start the server
Заголовок раздела «Start the server»-
Copy the config to the voice machine and start LiveKit with it, such as with Docker.
Окно терминала docker run -d --name livekit --restart unless-stopped --network host \-v "$PWD/livekit.yaml:/etc/livekit.yaml:ro" \livekit/livekit-server:v1.12.0 --config /etc/livekit.yamlLiveKit’s own binary under systemd and its Helm chart take the same file.
-
Put a reverse proxy in front of port 7880, with a certificate for the endpoint’s hostname. It needs WebSocket upgrades and a read timeout of at least 120 seconds.
When the proxy runs on the voice machine itself, add
bind_addresses: [127.0.0.1]to the config so LiveKit listens only there. -
Open 7881/tcp and 7882/udp to the internet. Keep port 7880 closed to the internet, because LiveKit serves it without TLS.
-
A new server starts out draining. In the admin panel, open “Voice Servers” under Platform, edit the server and turn off “Draining”. With rexctl, run
rexctl voice test <id>to check it first, thenrexctl voice undrain <id>to turn draining off so that new calls can use it.
With rexctl on another machine
Заголовок раздела «With rexctl on another machine»rexctl voice join sets this up for you, with the certificate, the firewall and upgrades.
-
Create a join token on the Squad machine.
Окно терминала rexctl voice tokenIt prints the command to run on the voice machine. The token works once and stops working after an hour, or after up to 24 hours with
--expires. -
Run that command on the voice machine.
Для Squad скачайте исходники и конфигурацию сборки. Команда получения готового пакета для этой платформы отсутствует.
rexctl opens the ports in ufw or firewalld, gets a certificate and tests the server. When a step fails, run the same command again.
Where it runs
Заголовок раздела «Where it runs»| Machine | How the voice server runs |
|---|---|
| Debian 12 or later, or Ubuntu 22.04 or later, as root | Under systemd as fluxer-voice.service |
| Anywhere else | In one Docker or Podman container called fluxer-voice |
rexctl uses Podman when it’s the only one installed, and installs Docker when neither is. Pass --runtime systemd, --runtime docker or --runtime podman to choose.
Both run Squad in voice-only mode. That starts LiveKit and the part of Squad that gets the certificate, and nothing more than that.
Without root
Заголовок раздела «Without root»Without root, the container runs on your own Docker or Podman account.
Rootless containers can open ports 80 and 443 only when this setting is 80 or lower.
sysctl net.ipv4.ip_unprivileged_port_startIf not, pass --no-edge and use your own proxy.
Upgrades
Заголовок раздела «Upgrades»On a voice machine, rexctl status, logs, restart and doctor work for the servers there. A voice machine doesn’t upgrade with the Squad machine, so run rexctl upgrade or rexctl auto-upgrade on there as well.
An upgrade drains every server on the machine and waits up to 15 minutes for calls to end. It then moves the machine to your instance’s release.
Older voice machines
Заголовок раздела «Older voice machines»Voice machines set up with an older rexctl run each server in its own Docker container, and keep doing so. To move one to systemd or to one container, run one of these on it.
rexctl migrate --to systemdrexctl migrate --to dockerThe endpoints, keys and ports stay the same, and the Squad machine needs no change. rexctl drains the servers first. It goes back to the old containers if the new ones don’t start.
On the Squad machine
Заголовок раздела «On the Squad machine»On a systemd install with rexctl, you can add a server next to Squad.
rexctl voice addrexctl voice add --new-region fra --region-name Frankfurt --lat 50.1 --long 8.7rexctl picks the ID, ports, keys and a path on your domain and asks once. A server here shares the machine’s CPU with Squad.
It helps most when you give it a second public address with --ip.
Open the ports it prints in your provider’s firewall as well. Its test can’t see that firewall.
Hostnames
Заголовок раздела «Hostnames»Without a hostname, a joined server uses the machine’s IPv4 address with a short-lived certificate. To use a hostname, point its A and AAAA records at the machine and pass --hostname, or switch later with rexctl voice hostname <id> <host>. On Cloudflare, set the record to “DNS only”. Every server on one voice machine uses the same address.
A voice machine under systemd or in one container offers IPv4 and IPv6 when it has both. Callers with IPv6 only need an AAAA record for the voice machine’s hostname.
TURN servers
Заголовок раздела «TURN servers»A TURN server relays calls for people who can’t connect to a voice server directly. Squad doesn’t run one. Add yours with the FLUXER_LIVEKIT_TURN_SERVERS setting, or with rexctl on the Squad machine, and every voice server of your instance gives it to apps.
A plain LiveKit server gets the TURN servers in its config file. After you add or remove one, run the command from Plain LiveKit again with --id <id> of that server, then restart LiveKit so it loads the new config file.
rexctl voice turn add --host turn.example.com --secret-file secret.txtrexctl voice turn listWith --secret-file, set the same secret as static-auth-secret and turn on use-auth-secret in coturn. For networks that only allow port 443, add an entry with --protocol tls --port 443 to the list.
Ports and firewalls
Заголовок раздела «Ports and firewalls»| Port | Use |
|---|---|
| 7880/tcp | Signalling, behind your proxy and closed to the internet |
| 7881/tcp | Media, from this port up, one for each server |
| 7882/udp | Media, from this port up, one for each server |
| 80/tcp, 443/tcp | The certificate and the endpoint, on a voice machine with its own certificate |
Behind a router, forward each port to the same number on the machine.
A machine behind CGNAT usually can’t take calls.
On the Squad machine, rexctl voice test <id> joins a throwaway room on a server from outside. It reports whether UDP and TCP each connect.
A voice machine with its own web server
Заголовок раздела «A voice machine with its own web server»When nginx, another program or a Squad instance on the same machine has ports 80 and 443, pass --no-edge and your proxy’s address.
On a terminal, rexctl starts the server first. When the endpoint doesn’t go to it yet, rexctl prints where the proxy has to send it and waits until you say the proxy is ready. Before it registers the server, it checks with the server’s own key that the endpoint goes to the server on this machine. When the proxy sends it to another voice server, rexctl says so and lets you fix the proxy and check again.
The endpoint can’t be wss://<your domain>/livekit. Squad sends that path to the built-in voice server, so the single container already includes voice. Give this machine a hostname or path of its own.
When the endpoint’s hostname points at another machine and LiveKit listens only on 127.0.0.1, rexctl warns that a proxy there can’t connect. Pass --http-bind with an address of this machine.
rexctl voice join chat.example.com fvj_... --no-edge --endpoint wss://voice.example.com/livekit-fra-server-1LiveKit then listens without TLS on 127.0.0.1 from 7880 upwards, or on --http-bind. Point the path at it with WebSocket upgrades and a read timeout of at least 120 seconds.
When the proxy runs on another machine, pass --http-bind with an address of this machine, or 0.0.0.0 for every address, and --proxy-from with the proxy’s address. rexctl then opens the HTTP port in ufw or firewalld to that address only, next to the call ports. --proxy-from private opens it to every private address. Without --proxy-from, rexctl asks for the address on a terminal, and otherwise leaves the HTTP port closed and says so.
rexctl voice join chat.example.com fvj_... --no-edge --endpoint wss://voice.example.com/livekit-fra-server-1 --http-bind 0.0.0.0 --proxy-from 192.168.1.10Point the proxy at this machine’s own address, such as 192.168.1.20:7880, not at 0.0.0.0.
The built-in voice server
Заголовок раздела «The built-in voice server»The built-in voice server is the LiveKit server inside Squad. Settings and rexctl call it the bundled voice server. Each time Squad starts, it adds the server as default-server-1 in the region default, and creates that region first when it’s missing. Regions and servers you added stay as they are. When FLUXER_LIVEKIT_DEFAULT_REGION has another region ID, Squad uses that ID in place of default.
rexctl voice list shows the server with the ID default-server-1, the region default and the endpoint wss://<your domain>/livekit. After a move from the older layout, the regions and servers you had before the move stay in the list next to it.
To remove a server on a machine that’s gone, run rexctl voice remove <id> --forget. To delete a region and every server in it, open “Voice Regions” under Platform in the admin panel and click “Delete Region”. To start over, delete every region there and run rexctl restart, and Squad creates the region default with the built-in server again.
When you delete the built-in server or its region in the admin panel, calls can’t use it until Squad starts again and adds it back. While the region is still there, rexctl voice resync default-server-1 adds the server back at once. To run without it for good, turn it off as the next section shows.
Run without the bundled voice server
Заголовок раздела «Run without the bundled voice server»Set FLUXER_LIVEKIT_BUNDLED=false, or run rexctl config set voice.bundled false. Calls then go only to the servers you add, and can’t start until you add one. FLUXER_LIVEKIT_ENABLED=false turns calls off.
Look after servers
Заголовок раздела «Look after servers»| Command | What it does |
|---|---|
rexctl voice list | Shows every server |
rexctl doctor | Checks the servers and says how to fix what it finds |
rexctl voice drain, resync and set | Change one server |
rexctl voice remove <id> | On the machine that runs the server, drains it, unregisters it and deletes it |
rexctl voice remove <id> --forget | On the Squad machine, removes a plain LiveKit server or one on a machine that’s gone |
Bot protection, such as Cloudflare’s, has to let voice machines through to /, /.well-known/squad, /api/voice/ and /api/webhooks/livekit.