Skip to content
Kaiov0.8.0

Versions & rollback

Every successful deploy records a new version of the stack: the full docker-compose.yml content and a JSON snapshot of its environment variables.

Interface How
Web stack ⋮ → Versions
TUI Select the stack, press v
CLI kaio-cli stack versions my-db

Selecting a version other than the current one opens on Diff vs current: the current compose file against the selected one, the variables a rollback would add, change or remove, and the images it would pull or stop using. File shows the version on its own, its compose file and its .env with secrets masked.

The versions dialog with version 3 selected: the current version 4 against version 3, the ghost image line going from 5.87 back to 5.86, the environment unchanged, and the image ghost:5.86-alpine to be pulled while 5.87 is no longer used.
Diff vs current: what a rollback to version 3 would change, before you press Rollback.
The versions dialog for a stack: the numbered history on the left, the selected version's Compose file on the right, and its .env snapshot underneath with secrets masked.
Version 3 selected: its Compose file and its environment are previewed together, and Rollback restores the pair.

In the web UI, Edit doesn’t deploy directly: its button reads Review changes, and shows what is running now against what the deploy would write, with the same summary of variables and images. Deploy applies it, Back to editor returns to the editor with nothing lost. A new stack has nothing to compare against, so its dialog deploys directly.

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: an image bump and a new variable, checked before the deploy.

Stack ⋮ → Timeline lays the stack’s history on one time axis, in four lanes: its versions, its own events (deploys, updates, rollbacks), its containers’ state changes, and its images’ scans and update checks. Click a point, or its row in the list underneath, to read it. A version shows what it changed against the one before it, with a button that rolls back to it.

The timeline of blog: four lanes of versions, stack events, containers and images on a shared axis, version 3 selected with the caddy image moved from 2.7 to 2.8 against version 2 and a Roll back to v3 button, then the list of every point, newest first.
Timeline: version 3 selected, and what it changed against version 2.

The events come from the latest 100 the server keeps across every stack, so a busy server shows a shorter history than a quiet one. The versions are always complete.

Terminal window
kaio-cli stack rollback my-db 3

In the TUI, open the version history with v, then press r on the target version. In the web UI, the Versions dialog has a rollback button per row.

A rollback restores both the compose file and the environment snapshot, then redeploys. It is itself a deploy, so it produces a new version: the history is append-only and you can always roll forward again.

Terminal window
kaio-cli stack version-rm my-db 3

TUI: d on the version row. This only drops the snapshot; the running stack is untouched.

Versions live in the stack_versions table (stack_id, version, content, env_snapshot), indexed on stack_id. Nothing is written to disk beyond the current compose.yml and .env. The history is entirely in SQLite, and it is deleted with the stack.

Kaio, built by Régis Gaidot