This page runs your own Klav server with Docker Compose and SQLite, creates your accounts, and closes registration so nobody else can make one. You need Docker with the compose plugin, and a copy of Klav’s source code, which has docker-compose.yml at its root.
Start it
-
From the folder with Klav’s source code, start the server with registration open, only for this start:
KLAV_ALLOW_REGISTRATION=true docker compose up -d --build -
Check that it answers:
curl http://127.0.0.1:8080/v1/health{"status":"ok","version":"…","registration_open":true,"account_deletion":true} -
Put a reverse proxy with TLS in front of it before any device connects from another machine: see TLS and a reverse proxy.
-
Create your accounts against your server’s address, with the Mac app (“Use my own server”) or the CLI. See Create an account:
klav signup --server https://klav.example.com --email you@example.com -
Close registration by starting the server again without the variable:
docker compose up -d/v1/healththen says"registration_open":false, and a client tells you before it asks for a password. Check thatKLAV_ALLOW_REGISTRATIONisn’t left in your shell or in a.envfile next todocker-compose.yml: Compose reads both.
What the Compose file does
- Publishes the port on
127.0.0.1:8080only. The server speaks plain HTTP: never expose it to the internet without TLS in front. - Keeps everything in the
klav-datavolume (/datain the container): the SQLite database and the attachments. - Runs locked down: as an unprivileged user (
klav, UID 10001), with a read-only file system, no capabilities andno-new-privileges. - Has a health check (
klav-server healthcheck), sodocker psshowshealthywhen it answers. - Keeps registration closed unless you set
KLAV_ALLOW_REGISTRATION=truefor one start.
Without Docker
Build and run the binary; SQLite is built in:
cargo build --release -p klav-server
./target/release/klav-server --config /etc/klav/server.tomlklav-server --version
klav-server healthcheckklav-server healthcheck exits with code 0 when the configured server answers on /v1/health, and 1 when it doesn’t. Without a file or variables, the server listens on 127.0.0.1:8080 and keeps its data in ./data. See Configuration.