Self-hosting
Try it on your computer
Run the kit on one computer with hostnames under .localhost and Caddy’s own certificates, without a domain or open ports. For trying it out, never for production.
The hostnames
Browsers send every hostname under .localhost to your own computer, so no DNS is needed. In .env
(after steps 1 and 2 of Install):
KLANG_DOMAIN=klang.localhost
KLANG_ADMIN_DOMAIN=admin.klang.localhost
KLANG_FILES_DOMAIN=files.klang.localhost
KLANG_VOICE_DOMAIN=voice.klang.localhost
LIVEKIT_USE_EXTERNAL_IP=false
LIVEKIT_NODE_IP=127.0.0.1If ports 80 and 443 are taken, set HTTP_PORT and HTTPS_PORT (for example 8180 and 8543):
the addresses then carry the port, like https://klang.localhost:8543. The voice ports can move
the same way (LIVEKIT_TCP_PORT, LIVEKIT_UDP_PORT, LIVEKIT_TURN_PORT).
Start it
Get the images (step 4 of Install), then add
compose.local.yml to every command:
docker compose -f docker-compose.yml -f compose.local.yml up -dWith -f, Compose no longer reads compose.override.yml by itself. If you have one, add
-f compose.override.yml too, or put the list in .env once and drop the -f flags:
COMPOSE_FILE=docker-compose.yml:compose.local.yml:compose.override.yml.
It makes Caddy sign the certificates with its own authority instead of Let’s Encrypt, and lets the API and the gateway trust that authority (they reach the files and LiveKit through Caddy). The browser warns once for each of the four hostnames: accept it for all four, or the files and voice won’t load.
Then register and create the admin as in a real install.
Stop it and clean up
docker compose -f docker-compose.yml -f compose.local.yml down # keeps the data
docker compose -f docker-compose.yml -f compose.local.yml down -v # deletes it