how to setup turn in self-hosting live kit server ...
# ask-ai
q
how to setup turn in self-hosting live kit server got the issue
✅ 1
t
Thanks for reaching out, Atik. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
q
and i have signaling through alb 443 -> 7880 and turn through nlb tls443- > 443 tcp
t
Thanks — that’s helpful context. You mentioned signaling is behind an ALB (443 → 7880) and TURN is behind an NLB (TLS 443 → 443). I’ll walk through the most likely causes and concrete checks to get TURN and WebRTC working with that topology, and then ask a couple quick questions so I can narrow the next steps. What I’m responding to: your LiveKit tester shows WebSocket signaling OK, but WebRTC, TURN, and publishing fail. Your setup: ALB terminates/forwards HTTPS/WSS to LiveKit signal on 7880, and an NLB forwards TLS 443 to your TURN server on 443. Quick summary of likely issues and fixes • TURN must be reachable on the public IP/host and ports you advertise to clients. If clients can’t reach TURN (or TLS certs don’t match), ICE will fall back and connections will fail. • Load balancer behavior and TLS termination matter: TURN generally expects TCP/UDP connectivity and proper TLS passthrough if using TLS. Using an NLB in TLS passthrough mode is correct for TURN/TLS; ALB is fine for signaling (HTTP/WSS) when it terminates TLS and forwards to LiveKit on 7880. • Firewall/SG rules must allow both the load balancers and LiveKit/coturn to receive traffic on the necessary ports and transports (UDP for media/relay, TCP for TLS). Concrete checks and actions (follow these in order) 1) Verify TURN server is actually reachable from an external client • From a machine outside your network, run a basic TCP/TLS check against your NLB public address on 443: ◦ curl -vk https://turn-public-host:443/ (this won’t return TURN functionality but will confirm TLS/TCP reachability) • Use a TURN/STUN test such as trickle ICE or the LiveKit Connection Tester pointed at your published TURN URL to confirm it returns candidates. For example, in the tester ensure TURN URLs match the NLB hostname (see step 3). 2) Confirm NLB is configured for passthrough (preserve client transport) and forwarding to the TURN server ports/protocols • NLB should be forwarding TCP 443 to the TURN instance on 443 without TLS termination or header modification. • Ensure the NLB target group uses the correct protocol (TCP) and health checks use TCP or TLS as appropriate. • If you need TURN over UDP (recommended for media), ensure NLB supports UDP listeners for ports like 3478 and whatever UDP ports your TURN uses for relayed media (or ensure coturn is configured to use TCP/TLS on 443 if you must). 3) Ensure your TURN URLs published to clients are correct and match TLS certs • TURN URLs in LiveKit should reference the NLB public hostname or IP and include transports, e.g.: ◦ turnturn.example.com3478?transport=udp ◦ turnturn.example.com3478?transport=tcp ◦ turnsturn.example.com443?transport=tcp • If you only expose TLS/TCP on 443 via NLB, ensure you publish the
turns:
URL and your TLS certificate on the TURN host matches the NLB hostname clients use. 4) TLS certificate and SNI • If the NLB is passthrough, TLS is terminated at the TURN instance — the TURN server must present a certificate valid for the public hostname. • If the NLB does TLS termination (not typical for TURN), the cert must be on the NLB and the connection between NLB and TURN must be trusted (and LiveKit may need to be configured accordingly). Prefer passthrough to keep TURN TLS on the TURN instance. 5) Open required firewall/SG/host ports (UDP + TCP) • At minimum ensure: ◦ TCP 443 (TURN over TLS) allowed from the internet to the NLB and to the TURN host. ◦ UDP 3478 (STUN/TURN) and UDP ephemeral ranges (commonly 50000–60000) allowed if you use UDP relays. ◦ Any ports LiveKit requires for SFU media (e.g., UDP media ports) open between LB and host. • The LiveKit tester output explicitly warned about blocked ports — double-check security groups, instance firewalls (ufw/iptables), and any corporate network firewalls. 6) coturn configuration highlights • If using coturn, confirm: ◦
listening-port
and
tls-listening-port
are set correctly for the ports you expose. ◦
external-ip
is set if coturn is behind NAT. ◦
lt-cred-mech
enabled and credentials or shared-secret match what LiveKit will use to generate credentials (or you advertise static user:pass). ◦ TLS cert and key paths are correct and readable by coturn. 7) LiveKit configuration • In
livekit.yaml
, enable TURN and list the exact TURN URLs you expect clients to use. Example: ◦ urls: ▪︎ "turnsturn.example.com443?transport=tcp" ◦ secret: turn-shared-secret • Restart LiveKit after changes. 8) Force relay mode to verify TURN • On a test client, set
iceTransportPolicy: 'relay'
so the client uses TURN only. If that fails, TURN is unreachable or misconfigured. Questions to narrow troubleshooting 1) Which TURN server software are you running (coturn or other)? Is TLS terminated on the NLB or on the TURN host? 2) What TURN URLs are configured in LiveKit (
livekit.yaml
) and what hostname do clients use to reach TURN? 3) Are you exposing UDP-based TURN (3478/relayed ports) through the NLB, or only TCP/TLS on 443? 4) Can you share the specific NLB listener & target group settings (protocol: TCP/UDP, health check type)? 5) Can you run a client with
iceTransportPolicy: 'relay'
and paste any new tester errors (or a short excerpt)? If you prefer, tell me the answers to questions 1–3 and I’ll give the exact coturn settings, NLB listener example, and the precise
livekit.yaml
snippet you should use next. , with interactive elements
q
.0.0.0\r\na=setupactpass\r\na=mid0\r\na=ice-ufragBHil\r\na=ice pwdFI0Ozo4DjkRhO9dvpbOhpgnq\r\na=fingerprint:sha-256 BDC93FC1799DD3B99B161E4E93A09C🇩🇪3D859FD0B81F01DF4669C819129CF9F3\r\na=ice optionstrickle\r\na=sctp-port5000\r\na=max message size262144\r\n"}, "offerId": 1} 2026-03-25T123926.197Z DEBUG livekit.transport rtc/transport.go:2776 processing offer {"room": "facility-room-22", "roomID": "RM_G2tmzQ4BtZmn", "participant": "web-user-21", "pID": "PA_iutab8MyDRa2", "remote": false, "transport": "PUBLISHER", "offerId": 1} 2026-03-25T123926.197Z DEBUG livekit.transport rtc/transport.go:786 ice gathering state change {"room": "facility-room-22", "roomID": "RM_G2tmzQ4BtZmn", "participant": "web-user-21", "pID": "PA_iutab8MyDRa2", "remote": false, "transport": "PUBLISHER", "state": "gathering"} 2026-03-25T123926.197Z DEBUG livekit.transport rtc/transport.go:817 ice connection state change {"room": "facility-room-22", "roomID": "RM_G2tmzQ4BtZmn", "participant": "web-user-21", "pID": "PA_iutab8MyDRa2", "remote": false, "transport": "PUBLISHER", "state": "checking"} 2026-03-25T123926.198Z DEBUG livekit.transport rtc/transport.go:828 peer connection state change {"room": "facility-room-22", "roomID": "RM_G2tmzQ4BtZmn", "participant": "web-user-21", "pID": "PA_iutab8MyDRa2", "remote": false, "transport": "PUBLISHER", "state": "connecting"} 2026-03-25T123926.198Z DEBUG livekit signalling/signalhandler.go:57 handling signal request {"room": "facility-room-22", "roomID": "RM_G2tmzQ4BtZmn", "participant": "web-user-21", "pID": "PA_iutab8MyDRa2", "remote": false, "request": {"trickle": {"candidateInit": "{\"candidate\":\"candidate:457849210 1 udp 2122260223 172.16.34.175 35123 typ host generation 0 ufrag BHil network-id 1\",\"sdpMid\":\"0\",\"sdpMLineIndex\":0,\"usernameFragment\":\"BHil\"}", "target": "PUBLISHER"}}} here is the logs
t
Thanks — this is helpful. I’m responding to the logs you pasted and your topology (ALB 443→7880 for signaling, NLB TLS 443→443 for TURN). The logs show host candidates (172.16.34.175) being gathered and ICE progressing to checking/connecting, but the client never gets relay (TURN) candidates and media publishing fails. That means the browser/Client never learned a usable TURN candidate — likely a TURN reachability, LB/TLS, or firewall/port issue. What to check next (step‑by‑step) 1. Confirm TURN is actually reachable from the client network ◦ From an external machine run a TCP/TLS probe against the NLB address: ▪︎ curl -vk https://turn-host:443 ▪︎ openssl s_client -connect turn-host:443 -servername turn-host ◦ If passthrough is configured, these should show the TURN host certificate and a successful TCP/TLS handshake. If the connection fails, the NLB or network path is blocking. 1. Verify the TURN URLs you advertise to clients match the public NLB hostname and transport ◦ If you only expose TLS on 443 through the NLB, the client TURN URL should be a "turns:" URL: ▪︎ e.g. turnsturn.example.com443?transport=tcp ◦ If you also expose UDP (e.g. 3478), include those URLs too. ◦ Make sure the certificate on the TURN host is valid for that hostname (SNI must match). 1. Confirm NLB is operating as TLS passthrough and forwarding the correct protocol ◦ NLB target protocol should be TCP (not TLS-terminating ALB). For TURN over TLS you want passthrough so coturn presents the cert. ◦ Health checks: use TCP or TLS health checks that succeed for the TURN instance. ◦ If you need UDP relays, the NLB must support UDP listeners for those ports (or expose UDP 3478 directly). 1. Check coturn configuration on the TURN host ◦ Ensure coturn listens on the ports you expect: ▪︎
listening-port=3478
and/or
tls-listening-port=5349
or
443
if you configured TLS there. ◦ If coturn sits behind NAT, set
external-ip=<public-ip>
so allocations return correct addresses. ◦ TLS cert/key paths must be correct and readable, and the cert must match the public hostname sent by clients. ◦
lt-cred-mech
must be enabled and credentials or shared-secret must align with LiveKit config. 1. Firewall / security group checks (very common cause) ◦ Ensure inbound from internet → NLB: TCP 443 (and UDP ports if used). ◦ Ensure NLB → TURN host: same ports allowed. ◦ Ensure LiveKit server and TURN host can reach each other as needed (if LiveKit generates TURN credentials or talks to TURN). ◦ If you rely on UDP relays, allow ephemeral RTP ranges (commonly 50k‑60k UDP) to the TURN host. 1. Force relay (diagnostic) ◦ On a test client set
iceTransportPolicy: 'relay'
to force using TURN only. If this fails, TURN is not reachable or credentials/certs are wrong. ◦ Watch the browser console and the LiveKit tester for TURN allocation errors or authentication failures. 1. Inspect logs for TURN allocation/auth errors ◦ coturn logs will show allocations and auth attempts. If you see failed auth or no incoming allocation attempts, the client isn’t reaching coturn. ◦ LiveKit logs should show which ICE servers are supplied to the client and any TURN credential generation errors. Targeted things I noticed in your logs you should confirm • The ICE candidate shown is a private host candidate (172.16.x.x). No server reflexive or relay candidate is shown — that indicates the client didn’t receive STUN/TURN reflexive or TURN relay candidates. • Signaling (WebSocket) is working, so token and signalling paths are fine; the break is in gathering usable remote candidates. Quick clarifying questions so I can give exact config snippets 1. Which TURN software are you running (coturn)? Is TLS terminated at the NLB or on the TURN instance (passthrough)? 2. What TURN URLs are currently configured in
livekit.yaml
(paste the
urls:
lines, redact secrets)? 3. Are you exposing UDP 3478 (or other UDP ports) through the NLB, or only TCP/TLS 443? 4. Can you share a short excerpt of coturn logs when a client attempts to connect (auth success/failure or allocation lines)? If you prefer, answer 1–3 and I’ll provide: • Exact coturn config for passthrough on port 443 (with
external-ip
, TLS config, and recommended options) • Example NLB listener/target group settings for TCP passthrough and optional UDP listeners • The precise
livekit.yaml
snippet you should use (TURN URLs + secret) and the test steps to validate success I’ll wait for your answers and can walk you through the exact coturn and LiveKit config to get relay candidates to appear in ICE. Sources: Agents telephony integration | LiveKit Documentation | Running LiveKit on AWS | LiveKit | Zscaler proxy configuration | Firewall Tips | Diagnosing Connection Errors with Connection Test Utility, with interactive elements
q
give me the proper steps to host self hosted live kit in production with corporate firewall give me whole steps
t
Thanks — I’ll give you a focused, step‑by‑step production checklist to self‑host LiveKit so it works reliably behind corporate firewalls. I’ll highlight the critical points (TURN, TLS/SNI, LBs, ports, and tests) and give concrete commands/config snippets you can apply. If you want I can then produce exact coturn, NLB, or livekit.yaml files based on your answers (domain names, whether TLS terminates on the LB or on instances, and whether you expose UDP). What I’m responding to: you need a full production deployment plan for self‑hosted LiveKit that will work inside corporate firewalls and NATs. High‑level architecture (recommended for production) • LiveKit server(s) for signaling and SFU (multiple AZs for HA). • Dedicated TURN servers (coturn) for relays — do NOT rely on host candidates only. • Fronting load balancers: ◦ ALB (TLS termination) or reverse proxy (nginx) for signaling (WSS/HTTPS) → forward to LiveKit on 7880. ◦ NLB (TCP/UDP passthrough) for TURN/STUN so coturn can present TLS certificates (preferred) and support UDP. • DNS + public TLS certs for your domain(s). • Monitoring, health checks, and autoscaling for production. Step‑by‑step production checklist 1) Plan DNS & TLS • Reserve a subdomain for LiveKit signaling (e.g., livekit.example.com) and one for TURN if you prefer (e.g., turn.example.com). They may be the same host. • Obtain valid TLS certs covering the hostname(s) (Let’s Encrypt or commercial). • For TURN over TLS (recommended for corporate networks), TLS must be presented by the TURN instance (NLB passthrough) or by the LB if it terminates TLS — but if the LB terminates TLS the TURN server must accept downstream plain TCP or rewrap TLS. Passthrough to coturn is simpler and safer. 2) Deploy LiveKit servers (signaling & SFU) • Choose deployment mode: Docker Compose, single binary, or Kubernetes (K8s recommended for HA). • Minimal production resources: start with 4 cores / 8GB RAM per LiveKit node; scale as needed. • Configure environment variables: ◦ LIVEKIT_API_KEY, LIVEKIT_API_SECRET ◦ LIVEKIT_URL (wss://livekit.example.com) • Example minimal livekit.yaml (adjust to your domain & ports):
Copy code
port: 7880
  bind_addresses: [""]
  rtc:
    tcp_port: 7881
    port_range_start: 50000
    port_range_end: 60000
  keys:
    your_api_key: your_api_secret
  logging:
    level: info
• Expose health check endpoint (default: :8081/health) and use it for LB health checks. 3) Deploy and configure TURN servers (coturn) • Use coturn as a production TURN implementation. • Run coturn on machines with public IPs or behind NLB passthrough. • Example /etc/turnserver.conf highlights: ◦ listening-port=3478 ◦ tls-listening-port=5349 (or 443 if you want TLS on 443) ◦ external-ip=PUBLIC_IP or public_ip/PRIVATE_IP (if behind NAT) ◦ realm=turn.example.com ◦ lt-cred-mech ◦ fingerprint ◦ cert=/etc/letsencrypt/live/turn.example.com/fullchain.pem ◦ pkey=/etc/letsencrypt/live/turn.example.com/privkey.pem ◦ min-port / max-port for relay range (e.g., 50000–60000) • Ensure coturn runs as a service and logs show successful allocation when clients connect. 4) Load balancer topology & configuration • Signaling (WSS/HTTPS): ◦ ALB or reverse proxy (nginx) terminates TLS → forward to LiveKit port 7880. ◦ ALB target group use HTTP or TCP as appropriate; health check on 8081/health. • TURN: ◦ Use NLB in passthrough mode for TURN so coturn presents TLS certificate and supports UDP. ◦ NLB listeners: ▪︎ TCP 443 → targets TCP 443 (coturn TLS) ▪︎ UDP 3478 → targets UDP 3478 (coturn STUN/TURN UDP) if used ▪︎ UDP relay range as needed (or ensure coturn relays on dynamic ports and those are reachable) ◦ Target health checks should be TCP or TLS where passthrough is used. • If you cannot expose UDP through NLB (cloud restriction), ensure TURN over TCP/TLS on 443 is available and advertise
turns:
URLs. 5) Firewall & Security groups (most critical) • From internet → ALB/NLB: ◦ TCP 443 (WSS/HTTPS and TURN/TLS) ◦ UDP 3478 (STUN/TURN) if using UDP ◦ UDP 50000–60000 (relay RTP/RTCP) if you expose relay UDP ports • ALB/NLB → instance security groups/hosts: same ports allowed. • LiveKit internal ports: ◦ TCP 7880 (signaling) ◦ TCP 7881 (rtc/tcp) ◦ UDP 50000–60000 (media) • For corporate clients: ensure your organization’s firewall allows outbound TCP 443. UDP may be blocked — that’s why TURN over TLS (443) is the most reliable fallback. • If corporate network uses DPI (e.g., Zscaler), add bypass rules for your TURN and LiveKit domains, or work with security team to allow the traffic. 6) Configure LiveKit to advertise TURN servers • In livekit.yaml or via env, add ICE servers:
Copy code
rtc:
    ice_servers:
      - urls:
          - "turn:turn.example.com:3478?transport=udp"
          - "turn:turn.example.com:3478?transport=tcp"
          - "turns:turn.example.com:443?transport=tcp"
        username: "username"        # OR use shared-secret approach
        credential: "password"
• Alternatively configure LiveKit’s turn.secret to generate ephemeral credentials (preferred) and ensure coturn is configured to accept the same credential mechanism (long‑term or ephemeral). 7) Security and secrets • Use long‑term credential mechanism (lt-cred-mech) or short lived (credential generation using a shared secret). • Store API keys and secrets in a secrets store (AWS Secrets Manager, Vault) — not in plain repo. • Enforce TLS 1.2/1.3; disable older cipher suites. 8) Test connectivity step by step • From public client network: a. WebSocket: verify wss://livekit.example.com connects. • curl -vk https//livekit.example.com443/ (returns or shows TLS handshake) a. TURN reachability: • openssl s_client -connect turn.example.com:443 -servername turn.example.com • If passthrough: you should see coturn certificate presented. a. Run LiveKit Connection Tester (or ConnectionCheck in client SDK): • checkWebsocket(), checkWebRTC(), checkTURN() a. Force TURN on a test client: • set rtcConfig: { iceTransportPolicy: 'relay' } and try to publish audio/video. This ensures you test relay path only. a. Use browser devtools to inspect ICE candidates: look for server reflexive (srflx) or relay candidates. If only host candidates appear, TURN never reached the client. 9) Troubleshooting checklist (if ICE never shows relay candidates) • Ensure TURN URLs sent to clients match the public hostname and transport (turns: for TLS). • Verify coturn logs for incoming allocate/auth requests — if none, the client isn’t reaching the TURN server (LB/firewall issue). • Check NLB listener/protocol: NLB must forward TCP/UDP (not terminate TLS) for coturn passthrough. • Confirm TLS certificate SNI matches hostname clients use. Mismatched cert triggers connection failure. • Confirm security groups/iptables allow NLB → coturn → port ranges. • If behind corporate DPI/proxy, ask IT to whitelist domains or use TLS on 443 and ensure SNI is allowed. 10) Production hardening & HA • Run multiple LiveKit nodes across AZs; use DNS or geo LB to direct clients to nearest region. • Run multiple coturn nodes behind NLB; advertise multiple TURN URLs in LiveKit so clients can failover. • Autoscale LiveKit workers and coturn based on load; set graceful drain times for audio sessions (10+ minutes). • Monitor: CPU, memory, number of active peers, ICE failures, TURN allocations. Set alerts on high ICE failure rate. 11) Monitoring and logs • Collect LiveKit logs (info/debug when troubleshooting), coturn logs, and LB/NGINX logs centrally (ELK/CloudWatch). • Alert on: ◦ rising percentage of ICE failures ◦ TURN allocation errors and authentication failures ◦ high packet loss or CPU spikes Quick commands & snippets • Start coturn (Ubuntu): sudo apt-get install coturn edit /etc/turnserver.conf as described, then sudo systemctl enable coturn sudo systemctl start coturn • Test TLS to TURN: openssl s_client -connect turn.example.com:443 -servername turn.example.com • Force TURN in JS client: await room Sources: Running LiveKit on AWS | LiveKit | Self-hosted deployments | LiveKit Documentation | Firewall Tips | Zscaler proxy configuration | Security Overview | LiveKit, with interactive elements
q
how to configure aws loadbalanacer for this
t
Thanks — I’ll give step‑by‑step AWS ALB/NLB configuration for LiveKit (signaling + TURN), plus the key checks. I’ll assume signaling on 443→7880 (ALB terminates TLS) and TURN on NLB passthrough 443→443 (coturn presents cert). If your TLS termination differs, tell me and I’ll adjust. What I’m responding to: how to configure AWS load balancers so signaling (WSS/HTTPS) and TURN (STUN/TURN) work in production behind corporate firewalls. 1) Architecture summary (recommended) • ALB (HTTPS/WSS) → listener TCP/TLS 443 (TLS termination) → Target group -> LiveKit on TCP 7880 • NLB (passthrough) → listener TCP 443 & UDP 3478 (and UDP relay ports if exposing) → Targets -> coturn instances (443 for TLS, 3478 for UDP) • Security groups: ALB and NLB allowed from internet; ALB → LiveKit and NLB → coturn allow required ports. 2) ALB (signaling) — config • Listener: ◦ Protocol: HTTPS ◦ Port: 443 ◦ TLS cert: attach ACM cert for livekit.example.com • Target group: ◦ Target type: instance or IP (match your deployment) ◦ Protocol: HTTP or TCP (use HTTP if LiveKit speaks HTTPS behind ALB; if ALB terminates TLS and forwards plain HTTP, use HTTP), Port: 7880 ◦ Health check: HTTP on /health or HTTP/1.1 to http://target:8081/health (or LiveKit health endpoint). Interval 10s, healthy threshold 2–3. • ALB settings: ◦ Enable HTTP/2 and sticky session not required for WebRTC. ◦ Idle timeout: 120–300s (to accommodate long WSS connections). • Security group: ◦ Allow inbound TCP 443 from 0.0.0.0/0 (or restricted CIDRs) ◦ Allow ALB SG to reach LiveKit instances on TCP 7880. 3) NLB (TURN/STUN) — config (passthrough) • Use NLB because TURN needs TCP/UDP passthrough and low‑level forwarding. • Listeners: ◦ TCP listener on port 443 → Target group TCP port 443 on coturn targets (for TURN/TLS) ◦ UDP listener on port 3478 → Target group UDP port 3478 on coturn targets (for TURN/STUN over UDP), if you expose UDP ◦ Optional: UDP listeners for relay range (e.g., 50000–60000) if you want NLB to forward UDP relayed ports (recommend exposing relay range or ensure coturn can allocate usable ports) • Target groups: ◦ Target type: instance or IP ◦ Protocol: TCP for TCP listeners, UDP for UDP listeners ◦ Health checks: TCP on the listener port (e.g., port 443) — NLB health checks are L4; use TCP success. • Preserve client source: NLB preserves client IP; coturn should be configured with external-ip if behind NAT. • Cross-zone load balancing: enable for even distribution. 4) Security groups & NACLs • NLB in front of coturn: NLB itself does not have SGs; ensure coturn instances’ SGs allow inbound from 0.0.0.0/0 or the NLB subnets on: ◦ TCP 443 (TURN/TLS) ◦ UDP 3478 (TURN/STUN) if used ◦ UDP relay range (e.g., 50000–60000) if exposed • ALB SG allow inbound TCP 443 from clients; LiveKit instances SG allow inbound from ALB SG on TCP 7880. • Ensure OS/firewall (iptables/ufw) on instances allows those ports. 5) TLS & SNI behavior • ALB: terminates TLS and presents certificate for livekit.example.com (good for signaling/WSS). • NLB: passthrough — coturn must present a certificate valid for the public TURN hostname (turn.example.com). Use same cert provider (Let’s Encrypt) and correct SNI. Verify with: ◦ openssl s_client -connect turn.example.com:443 -servername turn.example.com • If you must terminate TLS at LB (not recommended for TURN), ensure LB re-establishes TLS to coturn or use non‑TLS internal forwarding — this is more complex. 6) Health checks • ALB: HTTP/HTTPS health check to LiveKit health endpoint (8081/health or configured path). • NLB: TCP health check on port 443 (or UDP health check where supported). Ensure coturn answers TCP probe (it will accept TCP/TLS handshake). 7) DNS & advertised TURN URLs • Point DNS records: ◦ livekit.example.com → ALB (A/ALIAS) ◦ turn.example.com → NLB (A/ALIAS) • In LiveKit config advertise TURN URLs that clients will use: ◦ turnsturn.example.com443?transport=tcp ◦ turnturn.example.com3478?transport=udp (if UDP exposed) • Ensure certificates’ CN/SANs match the hostnames clients use. 8) Port ranges and UDP relays • coturn needs a relay port range (50000–60000 recommended). Ensure NLB and instance firewalls allow UDP on that range if you forward them. • If cloud provider doesn’t support per‑port UDP forwarding for ranges via NLB, rely on TURN over TCP/TLS (443) for corporate networks. 9) Testing checklist after LB setup • From external machine: ◦ curl -vk https://livekit.example.com (ALB TLS) ◦ openssl s_client -connect turn.example.com:443 -servername turn.example.com (NLB passthrough TLS -> coturn cert) • In browser client: ◦ Run LiveKit Connection Tester: WebSocket OK, TURN OK, WebRTC OK. ◦ Force relay: set iceTransportPolicy: 'relay' and confirm publish succeeds. • Inspect browser ICE candidates: should show srflx or relay candidates from turn.example.com. 10) Troubleshooting tips • If coturn TLS fails: check certificate on coturn instance and SNI; NLB passthrough will show coturn cert if correct. • If no relay candidates: check coturn logs for allocation/auth attempts — if you don’t see traffic, NLB or SG is blocking. • If health checks fail: ensure health probe ports and paths are reachable from ALB/NLB subnets. • For corporate DPI issues: advise IT to allow outbound TCP 443 to turn.example.com and livekit.example.com or add SNI bypass for those domains. If you’d like, I can: • Produce exact ALB listener/target group screenshots or commands (CloudFormation/Terraform) for your setup. • Provide a coturn config file tuned for NLB passthrough on 443 and relay range settings. • Give a sample livekit.yaml snippet with ice_servers configured for your domain. Which would you like next? , with interactive elements
q
how to work in live-kit aws marketplace
t
Thanks — I can help. Do you mean one of these for "work in LiveKit AWS Marketplace"? • Launch a LiveKit AMI/CloudFormation from AWS Marketplace (purchase & deploy prebuilt instance) • Configure a Marketplace deployment into your existing VPC (LBs, subnets, SGs, DNS) • Integrate a Marketplace LiveKit instance with your TURN/NLB/ALB setup and LiveKit config • Billing, licensing, or marketplace subscription questions Tell me which of the above you want and give: • Your preferred deployment method (EC2 AMI, CloudFormation, or Marketplace SaaS if available) • Whether you need the instance deployed into an existing VPC (yes/no) and the VPC region • Whether you want Marketplace to manage TLS/certs or you’ll attach your own certs I’ll then give an exact step‑by‑step for that path (including CloudFormation/Terraform snippets and post‑deploy config). , with interactive elements
q
livekit aws marketplace how to configure
t
Thanks — I can walk you through configuring the LiveKit AWS Marketplace listing. I just need a few answers to give exact step‑by‑step instructions tailored to your environment: 1. Which Marketplace listing are you using? (AMI, CloudFormation/Quick Start, or SaaS — paste the Marketplace URL or exact name.) 2. Deploy into an existing VPC or a new VPC? Which AWS region? 3. Single instance or HA (multi‑AZ, autoscaling) deployment? 4. TLS termination preference: ALB terminates TLS for signaling + NLB passthrough for TURN, or terminate TLS on instances? 5. TURN: do you want coturn bundled with the Marketplace image or a separate coturn cluster? Do you need UDP TURN (3478 + relay ports) or only TURN over TLS (443)? 6. Do you already have DNS and TLS certs (ACM or external) or need instructions to obtain them? 7. Load balancer preference: ALB+NLB (recommended) or only NLB/ALB? 8. Are you using IaC (CloudFormation/Terraform)? Want sample templates? 9. Any corporate firewall/proxy constraints (Zscaler/DPI/blocked UDP)? 10. Do you want production hardening (monitoring, secrets manager, autoscale) included? Answer the questions you can; I’ll provide: • Exact Marketplace launch & post‑launch steps, • ALB/NLB listener & target group settings, • coturn and livekit.yaml config snippets, • DNS/certificate steps and test commands, • Optional CloudFormation/Terraform snippets per your choices., with interactive elements
q
t
Thanks — got the Marketplace link. I can provide a full, tailored step‑by‑step configuration for that AMI. To generate exact instructions (ALB/NLB listeners, target groups, security groups, livekit.yaml, coturn.conf, DNS/ACM steps, and CloudFormation/Terraform snippets) please confirm these choices: 1. VPC: deploy into an existing VPC or create a new one? Which AWS region? 2. Topology: single EC2 instance or HA (multiple instances across AZs + autoscaling)? 3. TLS termination: ALB terminates TLS for signaling and NLB passthrough for TURN (recommended), or terminate TLS on instances? 4. TURN placement: coturn bundled on the Marketplace instance or a separate coturn cluster? Expose UDP (3478 + relay range) or only TURN over TLS (443)? 5. DNS & certs: do you have ACM certs for hostnames? What hostnames will you use for signaling and TURN (e.g., livekit.example.com, turn.example.com)? 6. Firewall constraints: are clients behind corporate proxies/DPI (Zscaler) or is UDP blocked (so TURN over TLS is required)? 7. IaC: do you want CloudFormation or Terraform snippets, or console steps? Answer any subset you like. Once you do, I’ll produce the complete configuration and commands for that exact deployment. , with interactive elements
q
how to use livekit after buying it cloud service from aws marketplace
t
Thanks — I can walk you through the exact post‑purchase steps. Quick question so I give the exact commands and screens you’ll follow: 1) Did you launch the Marketplace listing as an EC2 AMI (launched an instance), via the CloudFormation/Quick Start, or is this a SaaS/managed listing? 2) Do you want to use TURN over TLS (443 only, best for corporate firewalls) or expose UDP TURN (3478 + relay ports)? Answer those two and I’ll return a concise step‑by‑step: • where to find endpoints and credentials in AWS Marketplace/EC2 or CloudFormation, • ALB/NLB listener & target group settings, • how to configure LiveKit (livekit.yaml) and coturn (if bundled or separate), • DNS/ACM certificate steps, • testing steps (including forcing
iceTransportPolicy: 'relay'
)., with interactive elements