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/24docker compose up -dThe service is then available at http://localhost:8080.
What matters in that file
Section titled “What matters in that file”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 default127.0.0.1is not reachable from outside the container.KAIO_ALLOWED_NETWORKSand thekaionetwork: 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/24Kaio 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 inKAIO_TRUSTED_PROXIES, at a fixed address, with a shared secret: see Reverse proxy../data: holds both the SQLite database andstacks/<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_MCPleft out: the MCP endpoint is off until the variable says otherwise, and a container needsKAIO_MCP_ALLOWED_HOSTStoo, since/mcpanswers loopbackHostheaders only until you name one.KAIO_METRICSleft out:/metricsis 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.
Images
Section titled “Images”CI publishes to GHCR on every push to main and on tags:
ghcr.io/rgaidot/kaio:latestghcr.io/rgaidot/kaio:<short-sha>ghcr.io/rgaidot/kaio:<version>See Build and release for the full set of build and push targets.
Upgrading
Section titled “Upgrading”docker compose pulldocker compose up -dMigrations 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.
Related
Section titled “Related”Kaio, built by Régis Gaidot