Acknowledging your request: you want step-by-step self-hosting instructions, how to manage scale for 50 concurrent audio SIP calls (5 participants/room), SIP integration steps, and a monthly infra cost estimate. Below is a concise, actionable plan.
1) Deployment choices (pick one)
• Docker Compose (fast to get running; Caddy auto-SSL). Good for small clusters.
• Kubernetes with Helm (recommended for production scale and HA).
2) Core components to deploy
• LiveKit server (2 nodes for HA)
• Redis cluster (3-node) for coordination
• SIP gateway/service (livekit-sip)
• Load balancer (for signaling / WebSocket)
• TURN server (optional but recommended)
• Monitoring (Prometheus + Grafana) and logging
3) Step-by-step setup (high level)
1. Provision VMs or k8s cluster in your cloud of choice.
2. DNS & TLS: point domain (e.g.,
livekit.example.com) and provision certs (Caddy/Let's Encrypt).
3. Install Redis (3-node or managed Redis) and secure it (VPC-only, auth).
4. Deploy LiveKit servers:
◦ Docker: generate compose with livekit/generate, configure livekit.yaml (API key/secret, redis addr, turn config), docker-compose up -d.
◦ Kubernetes: add LiveKit Helm repo, set domain/redis/turn, helm install.
1. Configure TURN (TLS) for NAT traversal.
2. Deploy SIP service (livekit-sip) and configure it to point at your LiveKit API endpoint and Redis.
3. Open firewall ports:
◦ TCP 443 (TLS / signaling), TCP 7880 (if using nonstandard), UDP/TCP 5060/5061 (SIP), UDP RTP range (e.g., 10000–20000), TURN ports (5349), Redis internal port (6379 internal).
1. Setup Load Balancer: route signaling (TLS) to LiveKit nodes; use health checks and sticky sessions for WebSocket resilience.
2. Configure SIP trunks with your provider:
◦ For inbound: set provider to forward to SIP gateway public IP/hostname, register numbers.
◦ For outbound: configure auth/peer settings on SIP provider and in livekit-sip.
1. Create dispatch rules in LiveKit to map incoming SIP calls to rooms/agents (use the SIP dispatch API).
2. Test end-to-end: SIP provider → SIP gateway → LiveKit room → WebRTC clients/agents.
3. Add monitoring & alerting; run load tests and scale nodes as needed.
4) Scaling and capacity management for your scenario
• Target load: 50 concurrent SIP calls → 50 rooms × up to 5 participants = ~250 concurrent participants.
• Sizing recommendation (safe starting point):
◦ LiveKit nodes: 2 × 16 vCPU, 16 GB RAM, 10 Gbps NIC (each runs LiveKit + SIP gateway). Two nodes provide HA and headroom.
◦ Redis: 3 × small VMs (2 vCPU, 4 GB) or managed Redis.
◦ TURN: co-locate or small dedicated VM depending on client distribution.
• Placement notes:
◦ Rooms are single-node scoped; Redis coordinates across nodes.
◦ If one node fails, other nodes continue handling new rooms; existing rooms on failed node are disrupted unless you implement additional session handoff strategies.
• Scaling approach:
◦ Horizontal: add LiveKit nodes and rebalance new connections via LB.
◦ Autoscale on CPU/network metrics during bursts.
◦ For SIP call density, consider separate SIP worker nodes if SIP processing grows.
5) SIP integration specifics
• Use standard SIP (UDP/TCP/TLS). Do NOT attempt to bridge SIP over WebSockets to LiveKit.
• Expose SIP ports (5060/5061) and RTP port range to your SIP provider.
• livekit-sip will create SIP participants that join rooms; configure dispatch rules to assign rooms/agents.
• Ensure RTP payload and codecs (Opus preferred) match between SIP provider and LiveKit (transcoding may be required).
• If you need PSTN numbers, provision via providers like Twilio, Telnyx, etc., and point trunks to your SIP gateway.
6) Security & networking
• Keep Redis internal (VPC/subnet) and protected.
• Use TLS for signaling and TURN.
• Harden SIP with TLS, IP allowlists, and authentication for outbound trunks.
• Monitor RTP port usage and restrict to provider IPs where possible.
7) Monthly infra cost estimate (ballpark)
• 2 × 16 vCPU, 16 GB VMs (LiveKit + SIP): ~$140–$300 total/month depending on cloud/provider (e.g., $70–$150 each).
• Redis 3-node (small VMs or managed): ~$18–$80/month.
• Load balancer: ~$15–$40/month.
• TURN (if separate): ~$10–$50/month.
• Bandwidth (egress): ~20–50 GB/month → ~$2–$5 (varies by region/provider).
• Misc (DNS, logging, monitoring): ~$10–$30/month.
Estimated total monthly: approximately
$200–$500 depending on provider, VM SKUs, managed services, and redundancy choices. (If you use smaller VMs or a cheaper provider, costs can be lower; for more headroom or recording/noise-suppression, costs rise.)
8) Next steps I can help with
• Translate this into exact AWS/GCP/Azure VM SKUs and pricing for your region.
• Provide docker-compose or Helm values snippets for the config you need.
• Create a checklist for SIP trunk setup for a specific provider (Twilio/Telnyx/etc.).
Which next step would you like?
Sources:
Running LiveKit locally | LiveKit docs |
Deploying LiveKit | LiveKit docs |
Deploy to a VM | LiveKit docs |
Deploy to Kubernetes | LiveKit docs |
Deploying to custom environments | LiveKit Docs