Infrastructure requirements
TURN requires a public IP address, a domain name, and TLS certificates. The bundledcoturn service uses host networking and is intended for a Linux host with a public IP.
Setup
Create the coturn config
coturn/turnserver.conf and set:static-auth-secretto a strong random value (e.g.openssl rand -hex 32)realmto your TURN hostname (e.g.turn.your-domain.com)certandpkeyto the paths of your TLS certificate and key
docker-compose.yml for how to make certificates available inside the container.Match the server environment
In The signaling server uses these to issue time-limited HMAC-SHA1 credentials for coturn. Credentials expire after 24 hours.
.env:Open firewall ports
On the host, open the following ports:
| Port | Protocol | Purpose |
|---|---|---|
3478 | UDP/TCP | STUN and TURN |
5349 | UDP/TCP | TURNS (TURN over TLS) |
49152-65535 | UDP | Relay data range (configurable in turnserver.conf) |
Verify
Check that the signaling server returns TURN credentials:turn: and turns: entries alongside STUN:
How credentials work
The signaling server generates time-limited credentials using HMAC-SHA1. The username is{expiry_unix_timestamp}:floeuser and the password is base64(HMAC-SHA1(TURN_SECRET, username)). coturn validates these against the shared secret without needing a database of user accounts.