Common operational commands for thoreau. Most docker commands must run from /srv/docker (where compose.yml lives).

See also:

Services (Docker Compose)

All from /srv/docker:

ActionCommand
Statusdocker compose ps
Start alldocker compose up -d
Stop alldocker compose down
Restart onedocker compose restart <service>
Logs (follow)docker compose logs -f <service>
Pull + recreatedocker compose pull && docker compose up -d

Service names: postgres redis vaultwarden paperless forgejo forgejo-runner

The stack is normally managed by systemd, not by hand:

ActionCommand
Start/stop the whole stacksudo systemctl start|stop selfhosted.service
Check stack unitsystemctl status selfhosted.service
Enable on bootsudo systemctl enable selfhosted.service

Prefer docker compose for per-service work; use the systemd unit for full-stack start/stop so ordering (WireGuard → docker → stack) is respected.

WireGuard & tunnel

ActionCommand
Tunnel status / handshakesudo wg show
Bring tunnel up / downsudo systemctl start|stop wg-quick@wg0
Forgejo SSH tunnel statussystemctl status forgejo-tunnel.service
Restart Forgejo SSH tunnelsudo systemctl restart forgejo-tunnel.service

A healthy wg show shows a recent handshake with peer 10.100.0.1 and nonzero transfer. If git-over-SSH fails but web services work, suspect forgejo-tunnel.service.

Storage

ActionCommand
Pool overviewsudo btrfs filesystem show
Usage / profile (per mount)sudo btrfs filesystem usage /store/data
List subvolumessudo btrfs subvolume list /store/data
Quota usagesudo btrfs qgroup show -reF /store/data
Scrub (integrity check)sudo btrfs scrub start /store/data
Scrub statussudo btrfs scrub status /store/data

Always query a mounted subvolume path (e.g. /store/data), not the bare /store directory — the latter reports the wrong filesystem.

Confirm raid1 on the HDD pool: sudo btrfs filesystem df /store/data should show Data, RAID1 and Metadata, RAID1.

Adding HDDs to the pool

sudo btrfs device add /dev/sdX /dev/sdY /store/data
sudo btrfs balance start -dconvert=raid1 -mconvert=raid1 /store/data

raid1 keeps two copies regardless of device count; mixed drive sizes are fine. Balance runs live but is slow on a full pool.

Health checks

External (from anywhere — proves the whole VPS→tunnel→thoreau path):

curl -sS https://code.bonhamlab.bio/api/v1/version
curl -sS -o /dev/null -w "%{http_code}\n" https://documents.bonhamlab.bio
curl -sS https://pw.bonhamlab.bio/alive

Local DB liveness:

docker exec selfhosted-postgres-1 psql -U postgres -c '\l'

Updates

System (Tumbleweed rolling — the one risky action):

sudo zypper dup

If an upgrade breaks the system, reboot and pick the pre-upgrade snapshot from the GRUB menu (snapper rollback). This is the safety net that makes rolling updates acceptable on a server.

Container images:

cd /srv/docker && docker compose pull && docker compose up -d

Runners

Runner admin (rename, remove, status) is in Forgejo’s web UI under Site Administration → Actions → Runners — not the user or repo scope, which only shows runners without full controls. Don’t edit the runner in the database.

Backups

Backup operations and restores are documented separately in thoreau Backup and Restore.