Skip to content

Docker Compose

RTCstack ships a single docker/docker-compose.yml that starts the entire stack.

Services

ServiceImagePortPurpose
caddycaddy:2.8-alpine80, 443TLS termination + reverse proxy
livekitlivekit/livekit-server:v1.7.27880 (internal)WebRTC SFU
egresslivekit/egress:v1.8.3Recording to MinIO/S3
coturncoturn/coturn:4.6.2-alpine3478, 5349, 49152-65535TURN relay
apiBuilt from apps/api/Dockerfile3000 (internal)RTCstack REST API
redisredis:7-alpine6379 (internal)Webhooks, transcripts, replay protection
miniominio/minio:RELEASE.2024-04-06T05-26-02Z9000, 9001Object storage (recordings)
minio-initminio/mcOne-shot bucket creation

Starting the Stack

bash
cd docker
cp .env.example .env
# Fill in required values (see Environment Variables)

# Start infrastructure only (no API — use for local SDK dev)
docker compose up livekit redis minio minio-init

# Start everything
docker compose up

# Start with speech-to-text add-on
docker compose --profile stt-live up
docker compose --profile stt-post up

Health Checks

All services have Docker healthchecks. Wait for healthy before starting the API:

bash
docker compose ps

livekit and redis must show (healthy) before the API can connect to them.

Networking

All services communicate over a private bridge network rtcstack_internal. Only Caddy exposes ports 80 and 443 to the host. coturn additionally needs its UDP port range exposed for TURN media relay.

Persistent Volumes

VolumePurpose
minio_dataRecording file storage
redis_dataWebhook configs, transcription segments
caddy_dataTLS certificates (auto-renewed by Caddy)
caddy_configCaddy config state

Updating Services

Pull new images and restart:

bash
docker compose pull
docker compose up -d --remove-orphans

For major LiveKit upgrades, check the LiveKit changelog for breaking config changes before pulling.

Resource Recommendations

ServiceCPURAMNotes
livekit2 cores2 GBScale per concurrent room count
egress4 cores4 GBOne egress container per ~4 concurrent recordings
coturn1 core512 MBLow CPU; network bandwidth is the constraint
redis0.5 cores256 MBMinimal — only light key-value use
minio1 core512 MBDisk throughput matters more than CPU
api0.5 cores256 MBStateless — run multiple replicas