Skip to content
Kaiov0.8.0

Configuration

All configuration is environment-based; there is no config file.

Variable Description Default
KAIO_ADDR Address to bind the server (and for the CLI to target): host:port, or unix:/path/to.sock for a Unix socket 127.0.0.1:8080
KAIO_ALLOWED_ORIGINS Comma-separated origins a browser page may call the API from, besides the dashboard’s own. Unset allows same-origin calls only. * lets any page read the API and still refuses its writes (unset)
KAIO_DB SQLite connection string sqlite:./kaio.db
KAIO_STACKS_DIR Directory holding the stacks’ compose.yml files (derived from the DB path)
KAIO_DOCKER_HOST Custom Docker socket or host local defaults
KAIO_EVENTS_RETENTION_DAYS How many days to keep events before deletion 30
KAIO_METRICS_RETENTION_HOURS How many hours of CPU, RAM and network history to keep. The charts can never reach further back 24
KAIO_LOGS_TAIL Past log lines loaded when opening logs (0 to 10000; per container for stacks). Overridable per request with ?tail= / --tail 100
KAIO_UPDATE_CHECK_INTERVAL_HOURS Interval for the automatic image update check, for every stack (0 disables it) 12
KAIO_AUDIT_RETENTION_DAYS How many days to keep the audit log 90
KAIO_NODE_HEALTH_INTERVAL_SECONDS Interval for the automatic probe of every node in the cluster (0 disables it) 60
HOSTNAME Fallback for the name kaio-cli join asks for, when /etc/hostname cannot be read (from the OS)
RUST_LOG Logging level (tracing) info

Kaio authenticates no one: these say whom it trusts to say who calls, and what each kind of caller may do. See Security for the model and Reverse proxy for ready-made setups.

Variable Description Default
KAIO_TRUSTED_PROXIES Comma-separated IPs or CIDR ranges of the reverse proxies whose identity headers count. A request from anywhere else has its identity headers dropped (unset)
KAIO_PROXY_SECRET_FILE File holding the secret the proxy sends as X-Kaio-Proxy-Secret. Once set, a request from a trusted proxy without it is not treated as coming from the proxy (unset)
KAIO_PROXY_SECRET The same secret, from the environment. Prefer the file: the environment shows in docker inspect and /proc (unset)
KAIO_ALLOWED_NETWORKS Comma-separated IPs or CIDR ranges allowed to connect directly, with no identity: a tailnet, a WireGuard range, the Compose network (unset)
KAIO_IDENTITY_USER_HEADER Header carrying the user name, read from a trusted proxy only Remote-User
KAIO_IDENTITY_GROUPS_HEADER Header carrying the user’s groups, comma-separated Remote-Groups
KAIO_GROUPS_READ Comma-separated groups granted read (unset)
KAIO_GROUPS_WRITE Comma-separated groups granted write (unset)
KAIO_GROUPS_ADMIN Comma-separated groups granted admin (unset)
KAIO_PROXY_LEVEL Level of every proxied user: their groups can raise it, never lower it admin with no group mapping, off with one
KAIO_LOCAL_LEVEL Level of a call from the loopback or the Unix socket that does not come through the proxy admin
KAIO_NETWORK_LEVEL Level of a call from KAIO_ALLOWED_NETWORKS admin
KAIO_CLUSTER_LEVEL Highest level this server grants its control plane, whatever level the signed call asks for admin
KAIO_I_UNDERSTAND_NO_AUTH yes lets the server listen off the loopback with nothing above set, as before 0.6.0: anyone who reaches the port drives the daemon. The flag --i-understand-no-auth does the same (unset)

A KAIO_ADDR off the loopback refuses to start unless KAIO_TRUSTED_PROXIES, KAIO_ALLOWED_NETWORKS or KAIO_I_UNDERSTAND_NO_AUTH is set, or the server has joined a cluster and holds its control plane’s key. kaio-server setup lan, setup proxy <IP> and setup local write the usual cases into kaio.env, after asking: see Pick your case. An unreadable value in any of these stops the server rather than widening what it accepts.

See MCP server.

Variable Description Default
KAIO_MCP The highest rung of tools at /mcp: off, read, write or admin. Each caller gets this or its own level, whichever is lower. off does not route the endpoint at all. A node that joined a control plane refuses it whatever this says: its agents go through the control plane off
KAIO_MCP_ALLOWED_HOSTS Comma-separated Host values /mcp answers, on top of the loopback names always accepted. Unset refuses every remote client; * accepts any host (unset)
KAIO_MCP_ALLOWED_ORIGINS Comma-separated browser origins allowed to call /mcp. Unset refuses every request carrying an Origin header, which is what agents and CLIs send (none) (unset)

See Prometheus and Grafana.

Variable Description Default
KAIO_METRICS on serves the Prometheus endpoint at /metrics. off does not route it at all off
KAIO_METRICS_TOKEN Bearer token a scrape must carry. Unset serves /metrics to anyone who can reach the port, and it lists stack names, image names and CVE counts (unset)
Variable Description Default
KAIO_TRIVY_IMAGE Scanner image used for vulnerability scans aquasec/trivy:latest
KAIO_TRANSFER_IMAGE Image of the throwaway container that reads and writes volumes when a stack is moved. Needs tar, du and a shell alpine:3
KAIO_TRIVY_CONCURRENCY Max number of concurrent scans 2
KAIO_TRIVY_SCAN_INTERVAL_HOURS Interval for the automatic rescan of in-use images (0 disables it) 24
DOCKER_HOST Fallback when KAIO_DOCKER_HOST is unset, used to give the scanner container access to the daemon unset

The TUI opens a stack’s compose.yml in an external editor for E, and for the compose draft of a new stack.

Variable Description Default
VISUAL Editor command, tried first. A command with arguments works (code --wait) unset
EDITOR Editor command, tried when VISUAL is unset unset

With neither set, the TUI falls back to vi.

Read when the binaries are compiled, not when they run. They are only needed where .git is absent, which is the case inside the Docker build: the build script falls back to git rev-parse in a checkout, and to dev otherwise.

Variable Description Default
KAIO_GIT_SHA Short SHA stamped into kaio-cli version and kaio-cli --version (read from git, else dev)

The dashboard is read at compile time as well, from backend/crates/server/web, which the server’s build script fills from frontend/dist. A release build with neither fails rather than handing you a server with no dashboard; a debug build gets a placeholder page and a cargo:warning. See Build and release.

  • Binding. KAIO_ADDR defaults to 127.0.0.1:8080, which is not reachable from outside a container. In Docker, set it to 0.0.0.0:8080 and name the Compose network in KAIO_ALLOWED_NETWORKS, as Deploy with Compose does: a request through a published port reaches the container from that network, not from its loopback.
  • A Unix socket. KAIO_ADDR=unix:/run/kaio/kaio.sock serves the API on a socket created mode 0660, and every call on it is local. The CLI and the TUI accept the same value, the shell included.
  • The CLI reads the same variable to find its server, so exporting KAIO_ADDR once configures both. Set it per command. A full URL works there, and credentials in it are sent as Basic auth, which is how the CLI reaches a server behind an authenticating proxy: KAIO_ADDR=https://ci:$TOKEN@kaio-api.example.net, the in-container shell included. See Hardening.
  • Stacks directory. When unset, it is derived from the database path: a DB at /app/data/kaio.db puts stacks under /app/data/stacks/. Both must be on the same persistent volume.
  • Web UI. The dashboard is compiled into kaio-server, so the binary serves everything that is not /api with no files beside it, wherever you put it, and there is no variable to point anywhere. Serving a build of your own means compiling it in, described in Build and release. Versions up to 0.3.11 read KAIO_STATIC_DIR for this; the variable is gone, and a line left in an env file is ignored.
  • Docker host. Leave KAIO_DOCKER_HOST unset to use the local defaults; set it to a unix:// path for a rootless Podman socket, as in Podman.

Kaio, built by Régis Gaidot