Lesson 6 / Unit 2: Self-Hosted Stack
Redis Clustering
Your second LiveKit node changes the architecture more than your tenth. The Redis block that joins them, why each call lives on one node, and what a node crash costs.
Your one LiveKit node is filling up. Turning it into two takes a two-line redis block in the config.
That second node changes the architecture more than going from two nodes to ten ever will. Rooms now have a home, every node needs its own public address, and a crashed machine takes its calls with it.
Redis Coordination
Redis turns a set of LiveKit servers into one cluster. It holds room state so that any node can answer where a room lives, it routes messages between nodes, and it doubles as the bus the SIP service uses to reach the cluster.
When Redis is configured, LiveKit switches to distributed mode on its own. Each node then reports its stats to Redis periodically, which is how the node that receives a create-room request can pick an available node to host it.
All of that is coordination state. Audio never touches Redis. That is why a modest managed instance handles a large fleet, and why Redis latency, availability and connection limits still need monitoring.
Redis carries coordination, never media. Use the Coordination path and Media path views: audio goes straight to the node that owns the room.
Open full sizeCluster Configuration
Every node runs the same livekit.yaml, and the only multi-node addition is the redis block. Here is a two-node-ready config, using the key names from LiveKit’s config-sample.yaml:
# livekit.yaml: identical on every nodeport: 7880rtc: tcp_port: 7881 port_range_start: 50000 port_range_end: 60000 # each node discovers and advertises its own public IP use_external_ip: trueredis: address: redis.internal:6379 # username: livekit # password: <from your secret store>keys: # your_api_key: <your_api_secret>If you run Redis with Sentinel or in cluster mode, the same block takes sentinel_master_name and sentinel_addresses, or cluster_addresses, in place of address. The SIP service has its own redis block. It must hold the same address (lesson 7 covers that config).
Room Placement
A room is hosted on exactly one node, chosen when the room is created. For voice, that means per call. Each call is placed once and stays where it was placed.
Signalling is looser: a client’s WebSocket can land on any node, and that node proxies messages to the one hosting the room. Media is different. It flows straight to the room’s node.
This is what makes calls-per-node the natural capacity unit, and the autoscaling lesson in unit 5, choosing the autoscaling signal, builds directly on it.
Node Reachability
Media flows to the node that owns the room, so each node must be reachable directly on its RTP range. RTP has no shared front door.
In practice, per node:
- a public IP, advertised by
use_external_ip: true(or set explicitly withnode_ip) - a firewall rule for the UDP range that covers
port_range_startthroughport_range_end, as in lesson 5 - the ICE TCP port (
7881) open to the internet
Signalling on port 7880 is the one piece that can sit behind a shared load balancer, because any node can accept a client’s WebSocket. The lack of a media front door resurfaces with force in scaling inbound SIP, when carriers expect a single address.
Node Failure
The calls on that node drop. Node death is call death. The rooms on a failed node end, and nothing moves them to a survivor mid-call.
So treat multi-node as more capacity and a smaller blast radius, not as failover. Designing as if calls survive a crash leads to recovery paths that were never tested, while the design that holds up accepts the drop and makes redial resumption cheap (an application-layer concern).
A planned shutdown is different. On SIGTERM, a LiveKit node enters draining mode: active rooms keep running, new rooms are refused, and the process exits once the last participant leaves. Deploys depend on that behaviour, and zero-downtime deploys builds the procedure on it.
Configuration Drift
Point the SFU and SIP services at the same Redis and the cluster assembles itself: nodes register, the SIP service routes calls into rooms. A mismatched Redis endpoint is one configuration error worth checking early.
The symptoms (jobs not dispatching, SIP calls landing nowhere) look like anything except a config string. Before you debug anything else on a new cluster, print the redis.address from every node’s config and from the SIP service’s config, and diff them.
Cluster Exercise
- Provision one Redis reachable from every LiveKit node and the SIP service.
- Add the identical
redisblock to every node’slivekit.yaml. - Give each node a public IP and
use_external_ip: true. - Open the RTP range and
7881on each node’s security group, matching config exactly. - Put signalling (port 7880) behind a load balancer that terminates TLS.
- Point the SIP service’s
redis.addressat the same Redis. - Place a test call, then kill that call’s node and confirm the call drops and a redial lands on the survivor.
Do it early
Go multi-node before you must. Two nodes at comfortable load teach you room affinity, deploy draining and per-node metrics while mistakes are cheap. Learning cluster behaviour for the first time during a capacity emergency is the expensive way to learn it.
Next: self-hosting the SIP service, the component that turns these rooms into phone calls and the first one that will need that shared Redis address.
Common questions
Does LiveKit send audio through Redis?
No. Redis carries coordination state: which node hosts each room, messages routed between nodes, and the bus the SIP service uses to reach the cluster. Audio flows directly to the node that owns the room, so a modest managed Redis handles a large fleet.
What happens to active calls when a LiveKit node dies?
They drop. Each room lives on exactly one node, so the calls hosted on a failed node end with it. Multi-node LiveKit reduces blast radius and adds capacity; recovery requires testing the client reconnect or telephony redial path.
How do I turn a single LiveKit server into a cluster?
Add the same redis block to every node's livekit.yaml and point the SIP service at the same Redis address. With Redis configured, LiveKit switches to distributed mode automatically. Each node still needs its own public IP and its own firewall rules for the RTP range.
We do this work for teams shipping voice agents: Self-Hosted Voice Agent .
Edit this lesson on GitHub ↗Discussion
Questions, corrections and war stories welcome. Sign in with GitHub to comment.