A tiny boot orchestrator + watchdog for your Docker stacks.
stackd decides which of your stacks come up at boot and keeps them alive — and it does it by driving the stacks program, not by reimplementing any of its logic. Think of it as the conductor: stacks knows how to bring a stack up, repair it, or recreate it; stackd just decides what to start, in what order, and with which strategy, then hands off.
It replaces Docker's own "restart whatever was running" autostart with something you actually control: a single config file listing exactly what you want running 24/7 — by whole stack or by individual service.
Docker's default boot behavior just restarts whatever had restart: always — all-or-nothing, no ordering, no health escalation. If you run dozens of stacks but only want a handful up 24/7 (reverse proxy, DNS, auth, tunnel…) with the rest asleep until something wakes them, Docker can't express that. stackd can.
- On install,
stackdsets every container torestart=no— Docker stops auto-starting things.stackdis now in charge. - At boot,
stackd bootstarts only the services in your config, each viastacks up <stack> [service] <strategy>, escalating only if a service comes up unhealthy. stackd watchkeeps that set alive, healing anything that falls over.- Optionally it pre-pulls every other stack's images and leaves them stopped, so on-demand services start instantly when something wakes them.
go build -o stackd .
sudo cp stackd /usr/local/bin/
stackd config init # writes ~/.config/stackd/config.yaml
$EDITOR ~/.config/stackd/config.yaml
sudo stackd install --dry-run # preview exactly what it will change
sudo stackd install # write units + set restart=no
sudo systemctl enable --now stackd-boot.service stackd-watch.serviceRequires the
stacksprogram it drives, plus Docker and systemd.
start_strategy: repair # repair | fix | recreate — how each service is started
escalate: true # if it comes up unhealthy, try the steps below (only if needed)
escalation: [recreate, fix]
download_missing: true # pull every OTHER stack's images, leave them STOPPED
watch_interval: 30 # watchdog check interval (seconds)
stacks_cmd: /usr/local/bin/stacks
boot_services: # THE 24/7 LIST
- net_1 # a whole stack…
- net_2/traefik # …or a single service inside a stack
- net_3/authentik_serverstart_strategy— pickrepair,fix, orrecreatefor the first (gentle) start pass.boot_services—stackstarts the whole stack;stack/servicestarts just that one service. Mix freely.download_missing— make sure every stack's images are on disk without running them.
| command | what it does |
|---|---|
stackd boot |
start the configured 24/7 set (one-shot; used by the boot unit) |
stackd watch |
watchdog loop that keeps the 24/7 set alive |
stackd status |
show the config + which 24/7 services are up right now |
stackd install / uninstall |
manage the systemd units + Docker autostart |
stackd config init |
write a default, fully-commented config |
Every command accepts --dry-run.
- Thin on purpose. No repair/recreate/fix logic lives here — it all stays in
stacks. Improvestacks, andstackdbenefits for free. - Per-service granularity using the Compose project + service labels.
- Config resolution mirrors
stacks($STACKD_CONFIG_DIR→ invoking user's home under sudo →$XDG_CONFIG_HOME→~/.config) so the root-run boot unit still finds your config.
MIT