What is the correct configuration to use the Livek...
# ask-ai
f
What is the correct configuration to use the Livekit servers built in STUN service. I am self hosting livekit server
t
Thanks for reaching out, Heidi. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about the correct configuration to use LiveKit’s built‑in STUN service when self‑hosting. Below is the configuration you should add to the LiveKit server config (yaml) to enable the built‑in STUN server and expose it publicly:
Copy code
rtc:
  stun_servers:
    - address: "0.0.0.0"
      port: 3478
      public_address: "<http://your-domain.com:3478|your-domain.com:3478>"
What each field does: • address: "0.0.0.0" — binds the STUN service to all host network interfaces. • port: 3478 — standard UDP port for STUN. • public_address: "your-domain.com:3478" — the public DNS name and port clients should use to reach your STUN server (replace with your real domain). Important operational steps to make this work: • Open UDP port 3478 on your host firewall and any cloud security groups so clients can reach it. • Ensure your domain (the one in
public_address
) is publicly resolvable to your server IP. • Keep your LiveKit signaling endpoints reachable over HTTPS/WSS (so clients can connect to LiveKit for room setup). A valid TLS certificate is required for WSS. • Configure client SDKs to use your LiveKit URL (for example,
<wss://your-domain.com>
) and the same domain for STUN if you expose it there. If you want, I can help with next steps: • Verify your current config file if you paste it (remove any secrets). • Give commands to check UDP port 3478 is listening and reachable from the internet. • Provide the exact client SDK settings to point to your STUN address. Which of those would you like to do next? Sources: Running LiveKit on AWS