hallowed-mouse-36162
12/07/2025, 11:54 PMtall-airline-16756
12/07/2025, 11:55 PMtall-airline-16756
12/07/2025, 11:55 PMlivekit.yaml, docker-compose.yaml, caddy.yaml) on the host and mount them in your Compose services.
• Use Docker volumes for stateful data (example for Caddy TLS and other runtime state):
services:
livekit-caddy:
volumes:
- ./caddy.yaml:/etc/caddy/Caddyfile
- caddy_data:/data
livekit-server:
volumes:
- ./livekit.yaml:/etc/livekit/livekit.yaml
volumes:
caddy_data:
• If you use the provided systemd service (livekit-docker), it will start the Compose stack using the host configs in /opt/livekit. Restarting the service or recreating containers will keep your configuration as long as the host files and volumes remain intact.
If you want, tell me:
• Where your current config files live (default /opt/livekit or elsewhere), and
• Whether you need sample Compose volume entries for any other services (Redis, Postgres, etc.). Sources: Deploy to a VM | LiveKit docshallowed-mouse-36162
12/07/2025, 11:56 PMtall-airline-16756
12/07/2025, 11:56 PMservices:
redis:
volumes:
- redis_data:/data
volumes:
redis_data:
• Confirm your LiveKit server is pointed to that persistent Redis instance.
1. Persist config files and agent deployments
◦ Keep livekit.yaml, livekit.toml, agent Dockerfiles/code, and any generated config files on the host (default /opt/livekit) and bind‑mount them into containers so edits survive container recreation.
◦ Example mount:
services:
livekit-server:
volumes:
- ./livekit.yaml:/etc/livekit/livekit.yaml
- ./livekit.toml:/etc/livekit/livekit.toml
1. Persist secrets and environment settings
◦ Store secrets and env vars outside the container (env files, secret mounts) rather than baked into images.
◦ Use the secrets pattern or host files so restarts reuse the same credentials.
1. Version control and backups
◦ Keep agent code, livekit.toml, and dispatch/SIP configs in a git repo.
◦ Periodically export or back up your Redis/state store so you can restore rules and agent metadata if needed.
If you tell me where your settings are currently stored (answers to the questions above), I’ll give exact docker-compose volume entries and any API/CLI commands to export/import those SIP trunks, dispatch rules, and agent configs. Would you like that?
Sources: Distributed Setup | LiveKit docs | Deploy to a VM | LiveKit docs | Builds and Dockerfiles | LiveKit Docs | Secrets management | LiveKit docs | Deploying to production | LiveKit Docshallowed-mouse-36162
12/07/2025, 11:57 PMtall-airline-16756
12/07/2025, 11:57 PMlivekit.toml) and any local files you use to build agents should be kept on the host and version‑controlled.
What you should do to persist them
1. Ensure the state store is persistent
◦ If you use Redis, mount Redis data to a Docker volume or host path so Redis data survives container recreation:
services:
redis:
volumes:
- redis_data:/data
volumes:
redis_data:
• Confirm the LiveKit server is configured to point to that Redis instance.
1. Persist CLI-managed files and agent code
◦ Store livekit.toml, agent Dockerfiles, and any local config files on the host (default installer location is /opt/livekit) and bind‑mount them into containers:
services:
livekit-server:
volumes:
- ./livekit.yaml:/etc/livekit/livekit.yaml
- ./livekit.toml:/etc/livekit/livekit.toml
1. Store secrets and env vars externally
◦ Keep API keys and secrets in env files or secret mounts rather than baking them into images so restarts reuse the same credentials.
1. Backup and version control
◦ Commit agent code and config files to git and periodically back up your Redis/data volume so you can restore CLI-created rules if needed.
Quick clarifying question
• Which state store is your LiveKit server using right now (embedded, Redis, or another DB)? With that I can give exact docker-compose volume entries and a simple backup/restore command for your setup.hallowed-mouse-36162
12/08/2025, 12:01 AM# This docker-compose requires host networking, which is only available on Linux
# This compose will not function correctly on Mac or Windows
services:
caddy:
image: livekit/caddyl4
command: run --config /etc/caddy.yaml --adapter yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./caddy.yaml:/etc/caddy.yaml
- ./caddy_data:/data
livekit:
image: livekit/livekit-server:latest
command: --config /etc/livekit.yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./livekit.yaml:/etc/livekit.yaml
redis:
image: redis:7-alpine
command: redis-server /etc/redis.conf
restart: unless-stopped
network_mode: "host"
volumes:
- ./redis.conf:/etc/redis.conf
egress:
image: livekit/egress:latest
restart: unless-stopped
environment:
- EGRESS_CONFIG_FILE=/etc/egress.yaml
network_mode: "host"
volumes:
- ./egress.yaml:/etc/egress.yaml
cap_add:
- CAP_SYS_ADMIN
ingress:
image: livekit/ingress:latest
restart: unless-stopped
environment:
- INGRESS_CONFIG_FILE=/etc/ingress.yaml
network_mode: "host"
volumes:
- ./ingress.yaml:/etc/ingress.yaml
sip:
image: livekit/sip
network_mode: host
restart: unless-stopped
environment:
SIP_CONFIG_BODY: |
api_key: 'key_goes_here'
api_secret: 'secret_goes_here'
ws_url: 'ws://127.0.0.1:7880'
redis:
address: 'localhost:6379'
sip_port: 5060
rtp_port_range_start: 10000
rtp_port_range_end: 20000
local_ip: '::'
logging:
level: debugtall-airline-16756
12/08/2025, 12:01 AMredis:
image: redis:7-alpine
command: redis-server /etc/redis.conf
restart: unless-stopped
network_mode: "host"
volumes:
- ./redis.conf:/etc/redis.conf
- redis_data:/data
...
volumes:
redis_data:
caddy_data:
2) Move SIP config to a file (create sip.yaml next to your compose)
sip:
image: livekit/sip
network_mode: host
restart: unless-stopped
environment:
SIP_CONFIG_FILE: /etc/sip.yaml
volumes:
- ./sip.yaml:/etc/sip.yaml
Example sip.yaml (based on your current env block)
api_key: 'key_goes_here'
api_secret: 'secret_goes_here'
ws_url: 'ws://127.0.0.1:7880'
redis:
address: 'localhost:6379'
sip_port: 5060
rtp_port_range_start: 10000
rtp_port_range_end: 20000
local_ip: '::'
logging:
level: debug
3) Enable Redis persistence in redis.conf (if not already) Ensure redis.conf contains RDB/AOF persistence lines, e.g.:
save 900 1
save 300 10
save 60 10000
appendonly yes
appendfilename "appendonly.aof"
dir /data
Backup and restore notes (brief)
• Backup: periodically copy the volume (named redis_data) or use Redis BGSAVE and copy the RDB/AOF files from the host path.
• Restore: stop containers, restore RDB/AOF into the volume, then start containers.
If you want, I can:
• Provide exact commands to back up and restore the Redis volume on your host, or
• Show a minimal docker-compose full file with these changes incorporated.
Which would you prefer?
Sources: SIP APIs | LiveKit docs | Agents Framework | livekit/livekit_composite | DeepWiki | Distributed Setup | LiveKit docs | Deploying LiveKit | LiveKit docs | Self-hosted SIP server | LiveKit docshallowed-mouse-36162
12/08/2025, 12:06 AMtall-airline-16756
12/08/2025, 12:06 AMversion: "3.8"
services:
caddy:
image: livekit/caddyl4
command: run --config /etc/caddy.yaml --adapter yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./caddy.yaml:/etc/caddy.yaml
- caddy_data:/data
livekit:
image: livekit/livekit-server:latest
command: --config /etc/livekit.yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./livekit.yaml:/etc/livekit.yaml
redis:
image: redis:7-alpine
command: redis-server /etc/redis.conf
restart: unless-stopped
network_mode: "host"
volumes:
- ./redis.conf:/etc/redis.conf
- redis_data:/data
egress:
image: livekit/egress:latest
restart: unless-stopped
environment:
- EGRESS_CONFIG_FILE=/etc/egress.yaml
network_mode: "host"
volumes:
- ./egress.yaml:/etc/egress.yaml
cap_add:
- CAP_SYS_ADMIN
ingress:
image: livekit/ingress:latest
restart: unless-stopped
environment:
- INGRESS_CONFIG_FILE=/etc/ingress.yaml
network_mode: "host"
volumes:
- ./ingress.yaml:/etc/ingress.yaml
sip:
image: livekit/sip
network_mode: host
restart: unless-stopped
environment:
SIP_CONFIG_FILE: /etc/sip.yaml
volumes:
- ./sip.yaml:/etc/sip.yaml
volumes:
redis_data:
caddy_data:
Quick checklist after applying this compose:
• Create a sip.yaml next to this file (example content you already provided).
• Ensure redis.conf enables persistence and sets dir /data.
• Bring up with docker-compose up -d.
• Back up the redis_data volume regularly (or copy the RDB/AOF files from the host if you map them).
Would you like the exact example sip.yaml and a short command sequence to back up/restore the Redis volume?hallowed-mouse-36162
12/08/2025, 12:09 AMtall-airline-16756
12/08/2025, 12:09 AMapi_key: 'key_goes_here'
api_secret: 'secret_goes_here'
ws_url: 'ws://127.0.0.1:7880'
redis:
address: 'localhost:6379'
sip_port: 5060
rtp_port_range_start: 10000
rtp_port_range_end: 20000
local_ip: '::'
logging:
level: debug
Usage notes
• Keep this file under version control and back it up.
• After creating sip.yaml, run: docker-compose up -d to apply.
• Ensure redis.conf sets dir /data and persistence (RDB/AOF) so CLI-created SIP trunks/dispatch rules persist in Redis.hallowed-mouse-36162
12/08/2025, 12:13 AM# This docker-compose requires host networking, which is only available on Linux
# This compose will not function correctly on Mac or Windows
services:
caddy:
image: livekit/caddyl4
command: run --config /etc/caddy.yaml --adapter yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./caddy.yaml:/etc/caddy.yaml
- ./caddy_data:/data
livekit:
image: livekit/livekit-server:latest
command: --config /etc/livekit.yaml
restart: unless-stopped
network_mode: "host"
volumes:
- ./livekit.yaml:/etc/livekit.yaml
redis:
image: redis:7-alpine
command: redis-server /etc/redis.conf
restart: unless-stopped
network_mode: "host"
volumes:
- ./redis.conf:/etc/redis.conf
- redis_data:/data
egress:
image: livekit/egress:latest
restart: unless-stopped
environment:
- EGRESS_CONFIG_FILE=/etc/egress.yaml
network_mode: "host"
volumes:
- ./egress.yaml:/etc/egress.yaml
cap_add:
- CAP_SYS_ADMIN
ingress:
image: livekit/ingress:latest
restart: unless-stopped
environment:
- INGRESS_CONFIG_FILE=/etc/ingress.yaml
network_mode: "host"
volumes:
- ./ingress.yaml:/etc/ingress.yaml
sip:
image: livekit/sip
network_mode: host
restart: unless-stopped
environment:
SIP_CONFIG_FILE: /etc/sip.yaml
volumes:
- ./sip.yaml:/etc/sip.yaml
volumes:
redis_data:
caddy_data:
root@livekit:/opt/livekit# docker logs livekit-sip-1
open /sip/config.yaml: no such file or directorytall-airline-16756
12/08/2025, 12:13 AM/sip/config.yaml. Update the sip service to mount the host file to that path and set the env var accordingly.
Replace your current sip section with this:
sip:
image: livekit/sip
network_mode: host
restart: unless-stopped
environment:
- SIP_CONFIG_FILE=/sip/config.yaml
volumes:
- ./sip.yaml:/sip/config.yaml
Then ensure ./sip.yaml exists next to your compose file and contains valid fields (example):
api_key: 'key_goes_here'
api_secret: 'secret_goes_here'
ws_url: 'ws://127.0.0.1:7880'
redis:
address: 'localhost:6379'
sip_port: 5060
rtp_port_range_start: 10000
rtp_port_range_end: 20000
local_ip: '::'
logging:
level: debug
After applying the change:
1. Recreate containers:
◦ docker compose down
◦ docker compose up -d
1. Check logs:
◦ docker logs livekit-sip-1
If you still see an error, tell me the exact log output and confirm:
• ls -l ./sip.yaml shows the file exists and is readable,
• docker compose ps shows the sip container name (so I can reference correct logs). Sources: Self-hosted SIP server | LiveKit docs | SIP APIs | LiveKit docs | Self-hosting the Ingress Service | LiveKit docs