Skip to content
Kaiov0.8.0

Managing stacks

A stack is a Docker Compose project managed by Kaio. Its compose.yml and generated .env live under data/stacks/<name>/, and its metadata, versions and environment live in SQLite.

Every stack row carries a single state computed from its containers. The web UI draws it as a dot followed by its name; the TUI and the CLI spell it out:

State Dot Meaning
running Solid green Every container is up
partial Half-filled yellow Some containers are up, others are not
paused Solid teal Every container is paused
stopped Grey ring No container is running
empty Dashed ring The stack has no containers

CPU, RAM and network RX/TX are summed across the stack’s containers, with automatic unit conversion (B/s → GB/s, MB → GB) so a busy host stays readable.

From the web UI, the ⋮ menu of the stack groups every action; the TUI exposes the same set as single keys on the Stacks tab.

Action Web TUI CLI
Deploy a stack with no containers ⋮ → Deploy r stack restart <name>
Start ⋮ → Start Stack s stack start <name>
Pause / unpause ⋮ → Pause Stack p stack pause / stack unpause
Recreate ⋮ → Recreate R stack recreate <name>
Logs ⋮ → Logs l stack logs <name>
Edit compose + env ⋮ → ✎ Edit E stack deploy
Apply pending env ⋮ → ✓ Apply changes a stack apply <name>
Check for updates ⋮ → Check Updates c stack check-update <name>
Update (pull & recreate) ⋮ → Update u stack update <name>
Restart ⋮ → Restart r stack restart <name>
Version history ⋮ → Versions v stack versions <name>
Scan for CVEs ⋮ → Scan v on Images tab stack scan <name>
Delete ⋮ → Delete d stack rm <name>

Start, pause and resume act on the whole stack in a single call, backed by docker compose start, pause and unpause on the stack’s project. The web UI and the TUI read the stack’s current state to choose between pausing and resuming, so one key toggles both ways.

Recreate runs docker compose up -d --force-recreate --remove-orphans: every container is removed and created again from the current compose file, even when nothing changed, without pulling, and containers of services no longer in the file are removed. Named volumes keep their data. Paused containers are resumed first, since Docker refuses to remove them. Recreate reuses the .env on disk, so variables saved but not applied stay pending: use Apply changes for those. The web UI and the TUI ask before recreating.

Restart runs docker compose restart, which only acts on containers that exist. A stack that has none yet, such as a copy left stopped, is brought up with docker compose up -d instead, and the web UI offers Deploy in place of Restart at the top of its menu.

Kaio groups containers by the com.docker.compose.project label that Docker Compose puts on every container it creates, so a project brought up with docker compose up somewhere else on the host shows in the list too. Its compose.yml is not under data/stacks/<name>/, though, and every stack action runs Compose against that file, so Kaio marks such a stack external and keeps it read-only:

  • the web UI shows EXTERNAL next to its name, and its ⋮ menu holds only Timeline, Logs and Scan
  • the TUI shows ⇱ external and external in the version column; on the Stacks tab l still reads its logs and any other stack key answers with a line in the footer
  • kaio-cli stack ls lists it with external in place of a version, and --json sets "external": true, as kaio_overview and kaio_stack do for an agent on the MCP endpoint
  • the API, and so the CLI and the MCP tools, refuse any other stack action on it with a message naming the stack, rather than a not found
The stack list with home-automation marked EXTERNAL and its menu open, holding only Timeline, Logs and Scan.
A Compose project started outside Kaio: watched, scanned, not driven.

Its containers keep their own menu: start, stop, restart and pause go to Docker directly and need no compose file. To change the stack itself, run docker compose where it was started, or deploy it through Kaio under the same name to hand it over.

A stack Kaio deployed can end up here too, when its compose.yml is removed from data/stacks/<name>/ while its containers still run: it is then external, and no stack action, deleting included, reaches it any more. Deploy it again under the same name, with + STACK, kaio-cli stack deploy or kaio_stack_deploy: the file is written back, Compose takes the running containers over under the same project, and the stack is Kaio’s again, its version history kept.

The edit dialog holds the compose.yml in a Monaco editor (lazy loaded) and, below it, the environment table. Its button reads Review changes: it shows what is running now against what the deploy would write, the variables added, changed or removed, and the images to pull or no longer used. Back to editor returns to the editor with nothing lost.

The edit dialog for blog on its review step: the running compose file against the edited one, the ghost image moved from 5.87 to 5.88, LOG_LEVEL=debug added to the environment, the image to be pulled, and Back to editor and Deploy buttons.
Review changes: the diff of an edit, checked before the deploy.

Deploy then writes both together: the .env is rewritten, containers are recreated with docker compose up -d, and a new version is recorded. See Reviewing a deploy.

Deletion removes the stack’s containers with --remove-orphans, then its directory and database rows. It cannot be undone: the version history goes with it.

Kaio, built by Régis Gaidot