5349 and 3478, why are these ports used?
# ask-ai
a
5349 and 3478, why are these ports used?
t
Thanks for reaching out, Talha. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! Just to share a bit about ports 5349 and 3478 — they play a helpful role in LiveKit’s embedded TURN server, which really boosts WebRTC connectivity, especially in networks that can be a bit tricky. • Port 3478: This one handles TURN/UDP traffic and also offers STUN services. It’s great for helping clients connect their media when direct peer-to-peer connections don’t quite work out. • Port 5349: This port is all about TURN/TLS traffic, giving you encrypted TURN communication over TCP. It’s super important for situations where firewalls block non-TLS traffic or UDP is limited. While these ports are optional, we do recommend opening them to give your clients the best chance at seamless connectivity. If you’d like, I’m here to help walk you through any setup or answer any questions you have! Sources: Deploying LiveKit | LiveKit Docs | Connecting to LiveKit | LiveKit Docs | Ports and firewall | LiveKit Docs | pkg/service/turn.go | livekit-server/templates/deployment.yaml
a
I am hosting a dev and a test instance. Should I use different livekit agent and server for both or use the same? What do you suggest?
t
To help keep things running smoothly, it’s a great idea to use separate LiveKit agents and servers for your development and test instances. This way, you can keep your environments isolated and avoid any accidental mix-ups with real user traffic while you’re developing and testing. • If you’re using LiveKit Cloud, I recommend creating separate projects for each environment (like dev, test, and production). Each project will have its own URL, API key, and secret to keep everything nicely organized. • For self-hosted deployments, it’s best to have distinct deployments for staging and production, plus a local server dedicated to development. If you’d like, I’m here to help guide you through setting up these environments or configuring the connections—just let me know! Sources: examples/voice_agents/llamaindex-rag/data/raw_data.txt | Deploying to custom environments | LiveKit Docs
a
TCP Ports: 7890, 7891 UDP Ports: 51000-51003 i would need to open these ports for my livekit server to connect to
t
Thank you for sharing the ports you mentioned (TCP: 7890, 7891 and UDP: 51000-51003). These aren't part of LiveKit's default setup, so I’d love to understand a bit more. Are these ports from a custom configuration you’re working with, or did you come across them in a particular context like logs, firewall settings, or maybe a tutorial? Knowing this will really help us figure out their purpose and whether they need to be opened. I’m here to help you through this! Sources: Ports and firewall | LiveKit Docs
a
What ports do you recommend? So I can set them up in firewall rules
t
To help your LiveKit server run smoothly, you'll want to make sure your firewall is set to allow the following ports: • UDP 50000–60000: This handles WebRTC media traffic (ICE/UDP). • TCP 7881: Used as a fallback for WebRTC ICE/TCP. • TCP 7880: For API and WebSocket signaling. • UDP 3478 (optional): Supports TURN/UDP and STUN services. • TCP 5349 or 443 (optional): For TURN/TLS, which encrypts TURN traffic. These are the default ports, but you can always customize them in your configuration. If you’d like, I’m here to help you with any specific setups or adjustments you might need—just let me know! Sources: Ports and firewall | LiveKit Docs | cmd/server/commands.go | gclb-sample.yaml
a
My testing server has this config port: 7890 log_level: info rtc: tcp_port: 7891 port_range_start: 51000 port_range_end: 51003 use_external_ip: true redis: address: localhost:6379 keys: API52jpgUEUpFPb: 1iNqMQKXfRajZOjDKh73dLBRO0WhtROnDh3jLC3uQEM turn: enabled: true tls_port: 8366 domain: livekit-server-test.enteract.cloud cert_file: /etc/pki/tls/certs/star.enteract.cloud.crt key_file: /etc/pki/tls/private/star.enteract.cloud.key My dev server has this config: port: 7880 log_level: info rtc: tcp_port: 7881 port_range_start: 50000 port_range_end: 50003 use_external_ip: true redis: address: localhost:6379 keys: APIbLLHJzVJJEei: ZSLMLLihE5l8sauRKnmNRIFm9nvC73Yf3k96QOWzbgE turn: enabled: true tls_port: 8365 domain: livekit-server-dev.enteract.cloud cert_file: /etc/pki/tls/certs/star.enteract.cloud.fullchain.pem key_file: /etc/pki/tls/private/star.enteract.cloud.key When I try to run both of them, it is creating weird problems, sometimes the chat connect to one and sometimes to other and sometimes doesn't connect at all. What could be the issue with it?
t
I understand how frustrating connection issues can be, and I’m here to help you work through them. It seems like the overlapping configurations between your dev and test servers might be causing these challenges. Let’s look at a few important areas together: • Port Conflicts: It’s a good idea to make sure the
rtc.port_range_start
,
rtc.port_range_end
, and
rtc.tcp_port
values are unique for each server. For instance, you could assign non-overlapping ranges like 50000-50003 for dev and 51000-51003 for test. This helps avoid any clashes. • Redis Configuration: Both servers should ideally share the same Redis instance and configuration. This ensures smooth room state synchronization and participant routing, which is key for stable connections. • TURN Server: I see the
turn.tls_port
values (8365 and 8366) are different, which is great! Just double-check that the domain names and certificates are set up correctly and accessible to prevent any hiccups. • Use External IP: If
use_external_ip
is enabled, please make sure each server is advertising the correct public IP address. This helps avoid ICE negotiation conflicts that can disrupt connections. Once you’ve reviewed and adjusted these settings, try testing the connectivity again with tools like the LiveKit Connection Test Utility. If you’d like, I’m more than happy to guide you through any specific configuration or testing steps. Just let me know, and we’ll get this sorted out together! Sources: test/singlenode_test.go | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | Diagnosing Connection Errors with Connection Test Utility