gray-magician-34629
11/28/2025, 5:12 AMtall-airline-16756
11/28/2025, 5:12 AMtall-airline-16756
11/28/2025, 5:13 AMturn:
enabled: true
udp_port: 3478
tls_port: 5349
domain: your-turn-domain.com
cert_file: /path/to/cert.pem
key_file: /path/to/key.pem
• If you run LiveKit behind a proxy or load balancer, ensure the domain and certs match what clients will reach.
2) Coturn server basics
• Coturn must listen on the ports you declare (commonly UDP 3478 and TLS 5349).
• Coturn should be configured to issue time-limited credentials (long-term credential mechanism) so LiveKit can generate ephemeral TURN credentials for clients.
• Ensure Coturn has valid TLS certs if you enable TLS.
3) Network / firewall
• Open/forward:
◦ UDP 3478 (TURN/UDP)
◦ TCP/UDP 5349 (TURN/TLS and TURN/TCP)
◦ UDP media port range used for relay (commonly 49152–65535 or whatever you configure)
• Allow LiveKit server to reach the Coturn server on those ports.
4) Credential flow
• LiveKit expects to be able to generate TURN credentials for clients. Configure Coturn to accept the same credential method (shared secret / HMAC time-limited credentials). Confirm your Coturn user/credential setup matches how LiveKit will create credentials.
5) Verify
• Start both servers, then from a client behind restrictive NAT verify the client obtains a TURN relay candidate and media flows through the Coturn relay (browser debug tools show TURN candidate and relay IP).
• Check LiveKit and Coturn logs for allocation/auth errors.
If you’d like, tell me:
• Are you running Coturn on a separate VM, same host, or Kubernetes?
• Do you want a sample Coturn config snippet for long-term credentials and TLS? Sources: Deploying LiveKit | LiveKit docsgray-magician-34629
11/28/2025, 5:14 AMtall-airline-16756
11/28/2025, 5:14 AMlt-cred-mech
use-auth-secret
static-auth-secret=<YOUR_SHARED_SECRET>
• Listening ports and TLS (adjust paths):
listening-port=3478
tls-listening-port=5349
fingerprint
realm=your-turn-domain.com
cert=/etc/ssl/certs/turn.crt
pkey=/etc/ssl/private/turn.key
• Relay port range (example):
min-port=49152
max-port=65535
• Network and security:
external-ip=<PUBLIC_IP_OF_VM> # if behind NAT
no-stdout-log
log-file=/var/log/turnserver/turnserver.log
2) LiveKit config (livekit.yaml)
• Point LiveKit to the TURN domain and enable TURN. Example:
turn:
enabled: true
domain: your-turn-domain.com
udp_port: 3478
tls_port: 5349
cert_file: /path/to/cert.pem # if terminating TLS at LiveKit/proxy
key_file: /path/to/key.pem
• Ensure LiveKit uses the same static-auth-secret value so it can generate valid credentials for clients.
3) Networking & firewall
• Open these on the Coturn VM:
◦ UDP 3478, TCP/UDP 5349
◦ UDP relay range (e.g., 49152–65535)
• Allow LiveKit server IP to reach Coturn on those ports.
4) Verify
• From a client behind restricted NAT, confirm browser shows a TURN relay candidate and media flows via the Coturn IP.
• Check Coturn logs for allocations and auth entries; check LiveKit logs for TURN credential generation.
If you want, I can:
• Provide a ready-to-use example turnserver.conf tuned for your OS.
• Show exact LiveKit turn config for Kubernetes vs. bare VM.
Which would you prefer?gray-magician-34629
11/28/2025, 5:21 AMstatic-auth-secret value so it can generate valid credentials for clients.tall-airline-16756
11/28/2025, 5:22 AM