polite-dog-12152
12/30/2025, 1:31 PMtall-airline-16756
12/30/2025, 1:31 PMtall-airline-16756
12/30/2025, 1:31 PMadmin or call).
If you want, tell me:
• Which deployment method you prefer (Docker, Helm/K8s, VM, or binary), and
• Whether you already have a SIP provider or a phone trunk to connect,
and I’ll give step‑by‑step configuration details for that setup.
Sources: sip | livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki | Server-side | livekit/livekit_composite | DeepWiki | Running LiveKit on AWSpolite-dog-12152
12/30/2025, 1:32 PMtall-airline-16756
12/30/2025, 1:33 PMpolite-dog-12152
12/30/2025, 1:33 PMtall-airline-16756
12/30/2025, 1:33 PMpolite-dog-12152
12/30/2025, 1:34 PMpolite-dog-12152
12/30/2025, 1:34 PMtall-airline-16756
12/30/2025, 1:34 PMdocker-compose.yml (below is a minimal example). Replace domain, keys, and adjust ports if needed.
version: "3.8"
services:
livekit:
image: <http://ghcr.io/livekit/livekit:latest|ghcr.io/livekit/livekit:latest>
restart: unless-stopped
environment:
- LIVEKIT_API_KEY=${LIVEKIT_API_KEY}
- LIVEKIT_API_SECRET=${LIVEKIT_API_SECRET}
- LIVEKIT_DOMAIN=${LIVEKIT_DOMAIN}
- LIVEKIT_TLS_CERT=/certs/fullchain.pem
- LIVEKIT_TLS_KEY=/certs/privkey.pem
- LIVEKIT_SIP_ENABLED=true
- LIVEKIT_SIP_BIND_ADDR=0.0.0.0:5060
# Optional: SIP TLS port
- LIVEKIT_SIP_TLS_ENABLED=false
# Add TURN config if you have one
ports:
- "443:443"
- "7880:7880"
- "7881:7881"
- "7882:7882/udp"
- "5060:5060" # SIP UDP/TCP (basic testing)
- "5061:5061" # optional SIP TLS
volumes:
- ./certs:/certs:ro
Notes:
• LIVEKIT_SIP_ENABLED=true turns on the integrated SIP bridge.
• LIVEKIT_SIP_BIND_ADDR sets the SIP listening address/port. Twilio often uses 5060/5061.
• For production, run SIP over TLS (5061) and require secure credentials.
Step 5 — TLS certificates
• For tests you can place cert files at ./certs/fullchain.pem and ./certs/privkey.pem (from Let’s Encrypt or self‑signed).
• For Let’s Encrypt on a single VM you can use certbot:
sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo certbot certonly --standalone -d your.domain.example Then copy certs to ./certs (fullchain.pem and privkey.pem).
Step 6 — Configure Twilio SIP trunk Option A — Twilio Elastic SIP Trunk (recommended)
• In Twilio Console → Elastic SIP Trunking → Create a Trunk.
• Add a SIP URI or Origination URI that points to your VM domain/IP and port (e.g., sipyour.domain.example5060).
• Under Origination -> Add Primary Trunk Termination: set your server IP or domain, port 5060 (or 5061 for TLS).
• Configure Authentication: if using IP ACL, add your VM public IP to the Trunk’s Origination IP Access Control List. If using credential lists, create username/password and use SIP URI auth on LiveKit (see next).
Option B — Twilio SIP Domain (SIP Interface)
• Use a SIP Domain and configure Voice -> SIP Trunks to point to your LiveKit SIP endpoint.
Step 7 — LiveKit SIP routing / dispatch rules
• LiveKit routes incoming SIP calls into rooms using dispatch rules. For a simple test you can configure a default rule that maps any incoming DID to a room name.
Example: Use a small script or API call creating a SIP dispatch rule that maps incoming calls for a phone number to a room. You will call LiveKit server admin endpoints with a JWT that has SIP admin/grants.
Minimal programmatic flow:
1. Create an admin JWT with admin or call SIP grant using your `LIVEKIT_API_KEY`/`LIVEKIT_API_SECRET`.
2. POST to the LiveKit SIP API endpoint to create a SIP resource or dispatch rule linking the inbound SIP URI (or phone number) to a room.
If you want, I’ll give a concrete curl example to create a dispatch rule — tell me if you prefer curl, Python, or Node.
Step 8 — Firewall / Ports Open ports on your VM:
• 443 TCP (signaling / HTTPS)
• 7880-7882 (LiveKit internal ports used in many setups)
• 5060 TCP/UDP and/or 5061 TCP (SIP)
• UDP ephemeral ports for media (LiveKit/ICE will negotiate; ensure UDP is allowed)
Example ufw commands: sudo ufw allow 22/tcp sudo ufw allow 443/tcp sudo ufw allow 5060/tcp sudo ufw allow 5060/udp sudo ufw allow 5061/tcp sudo ufw enable
Step 9 — Start LiveKit docker compose up -d Check logs: docker compose logs -f livekit
Watch for SIP binding messages and successful certificate usage.
Step 10 — Test an inbound call
• From Twilio, configure an Origination/Voice webhook to point to your trunk.
• Place a call to your Twilio number. The SIP INVITE should arrive at your LiveKit SIP bind address and, if dispatch rules are set, join the specified room.
If you want sample JWT creation and a curl example to create a dispatch rule or SIP resource, tell me whether you want Node, Python, or curl and I’ll provide exact commands and sample payloads.
Summary — what I can provide next:
• Exact docker-compose.yml completed with your domain and keys
• Certbot commands and how to place certs into the container
• Example admin JWT creation and curl request to create a SIP dispatch rule
• Example Twilio trunk settings (origination URI and IP ACL entries)
Which of the above would you like me to produce now?