Skip to Content
keelbox

How keelbox works

keelbox plan acme      # list what apply would change; changes nothing
keelbox apply acme     # make the box match its config
keelbox doctor acme    # check the running box

Each box has one YAML config file. Edit it, run plan to see the effect, then apply. A second apply changes nothing.

Modules and steps

Apply runs these modules in order. Each is a list of steps: a check, and a change that makes the check pass.

ModuleSets up
hostpackages, the admin and agent accounts, key-only SSH, the firewall
accessTailscale
runtimeDocker, the GitHub CLI, Node and pnpm
sessionstmux, restored after a reboot
primerthe notes agents read about the box
logbookkeelbox's state and its binary
previewsdev servers on the tailnet
backuprestic and its timer
notifynotification channels
doctorthe scheduled doctor run
watchthe watch run
permissionspackage installs the agent asks for
agent-policythe agent CLIs' managed settings
agentsClaude Code and Codex, from the vendors' installers; Remote Control

A failed step stops the apply. Two exceptions: a failure in one account's files skips only that account's later steps, and a failed agent CLI install is recorded.

Where it runs

With target.provider: local, keelbox changes the machine it runs on. Otherwise it connects with your ssh, uploads its Linux binary and the config, and runs on the box with sudo, as a systemd unit that finishes without your computer.

Tool versions come from the release manifest inside keelbox, so a newer keelbox moves the box to newer versions at the next apply. Every apply, and every action an unattended run takes, adds a line to /var/lib/keelbox/logbook.jsonl on the box.

What a box does unattended

No keelbox process stays running. systemd starts short keelbox commands as root:

WhenWhat
Every two minutesThe watch run writes the status snapshot and restarts the agent's tmux server if it is down; every 15 minutes it saves the tmux sessions.
Hourly, or on doctor.scheduleDoctor runs. A check that starts or stops failing raises an event.
When the agent asks for a packageWith users.agent.permissions: auto, apt installs it.
On backup.scheduleThe backup runs.
At night, when an update needs itThe watch run reboots the idle box (host.auto_reboot).

These runs reach the box's apt sources, your notification channels and the backup repository, never keelbox's own hosts. The agent CLIs update themselves.

Edit on GitHub

Synced from keelbox/keelbox at e9770d0, 2 December 2026

On this page