Skip to content
Kaiov0.8.0

Deploy with Compose

services:
kaio:
image: ghcr.io/rgaidot/kaio:latest
container_name: kaio
ports:
- "127.0.0.1:8080:8080"
restart: unless-stopped
environment:
- KAIO_ADDR=0.0.0.0:8080
- KAIO_ALLOWED_NETWORKS=172.31.80.0/24
- KAIO_DB=sqlite:/app/data/kaio.db
- KAIO_EVENTS_RETENTION_DAYS=30
- KAIO_LOGS_TAIL=100
- RUST_LOG=info
# A reverse proxy on this network that authenticates, and the secret it sends
# - KAIO_TRUSTED_PROXIES=172.31.80.10
# - KAIO_PROXY_SECRET_FILE=/run/secrets/kaio_proxy_secret
# An AI agent over MCP, off unless you set it: read, write or admin, and
# the Host names /mcp answers on top of loopback
# - KAIO_MCP=read
# - KAIO_MCP_ALLOWED_HOSTS=kaio.example.net
# Prometheus scraping /metrics, off unless you set it, with a token in
# front of an endpoint that names your stacks, images and CVE counts
# - KAIO_METRICS=on
# - KAIO_METRICS_TOKEN=a-long-random-string
volumes:
# Required to inspect and control containers/images
- /var/run/docker.sock:/var/run/docker.sock:ro
# Persistent storage for the SQLite DB and user-deployed stacks
- ./data:/app/data
networks:
- kaio
networks:
kaio:
ipam:
config:
- subnet: 172.31.80.0/24
Terminal window
docker compose up -d

The service is then available at http://localhost:8080.

  • 127.0.0.1:8080:8080: the port is published on the host’s loopback only. Reach it from elsewhere through a proxy or a tunnel, never by widening this.
  • KAIO_ADDR=0.0.0.0:8080: the default 127.0.0.1 is not reachable from outside the container.
  • KAIO_ALLOWED_NETWORKS and the kaio network: a connection through the published port reaches the container from that network, not from its own loopback. Docker shows the network’s gateway, rootless Podman the container’s own address, both inside the /24 Kaio has to itself. Without this line the container refuses to start, since it listens off its loopback with nobody declared trusted. A reverse proxy joining that network goes in KAIO_TRUSTED_PROXIES, at a fixed address, with a shared secret: see Reverse proxy.
  • ./data: holds both the SQLite database and stacks/<name>/compose.yml. This is the one directory to back up.
  • The socket, read-only: enough for the Docker API, which takes commands over the protocol spoken on the socket rather than through writes to the file.
  • KAIO_MCP left out: the MCP endpoint is off until the variable says otherwise, and a container needs KAIO_MCP_ALLOWED_HOSTS too, since /mcp answers loopback Host headers only until you name one.
  • KAIO_METRICS left out: /metrics is not routed at all until the variable says otherwise. Turning it on is how Prometheus and Grafana get a history longer than the day Kaio keeps, and alerts on what only Kaio knows. See Prometheus and Grafana. Configuration lists every other variable with its default.

CI publishes to GHCR on every push to main and on tags:

ghcr.io/rgaidot/kaio:latest
ghcr.io/rgaidot/kaio:<short-sha>
ghcr.io/rgaidot/kaio:<version>

See Build and release for the full set of build and push targets.

Terminal window
docker compose pull
docker compose up -d

Migrations run automatically on startup and only move forward, so back up ./data before you pull. The full procedure, and the way back when it goes wrong, is in Upgrading.

Kaio, built by Régis Gaidot