Docs · Deploy

Deployment

The development candidate is designed for a single self-hosted node bound to loopback. Production deployment guidance remains intentionally conservative.

Build and start

go build -o watchpost ./cmd/watchpost
./watchpost --host 127.0.0.1 --port 7334 --data-dir /var/lib/watchpost

Do not run as root. Give the service account write access only to its data directory. The included packaging/watchpost.service is a starting point that must be reviewed for your paths and operating system.

The default listener is loopback 127.0.0.1:7334. --host/--port and WATCHPOST_HOST/WATCHPOST_PORT override it (CLI > environment > default; a --host 0.0.0.0 or WATCHPOST_HOST=0.0.0.0 binding exposes the port on all IPv4 interfaces and is intended only for controlled networks). The legacy single-address --listen flag and WATCHPOST_LISTEN environment remain supported and cannot be combined with the explicit host/port form.

Run Watchpost as a machine service

To keep the server running unattended and boot-safely on a systemd host, install it as a system service. The first install requires root and creates the dedicated unprivileged watchpost account, /var/lib/watchpost, the unit, and (optionally) the protected /etc/watchpost/watchpost.env configuration file:

sudo watchpost service install
# Optional install flags:
#   --host HOST
#   --port PORT
#   --listen HOST:PORT
#   --data-dir DIRECTORY
#   --secure-cookies
#   --env-file FILE
sudo watchpost service install --host 127.0.0.1 --port 7404
sudo watchpost service start
sudo watchpost service stop
sudo watchpost service restart
watchpost service status
watchpost service logs
watchpost service logs --follow
sudo watchpost service uninstall

Install the Watchpost Agent

The separate agent currently packages supported Linux amd64/arm64 archives. The installer verifies SHA256SUMS before writing anything.

# Current user, no sudo (binary only)
curl -fsSL https://watchpost-ops.github.io/agent-install.sh | sh

# Deliberate machine-wide binary location (still binary only)
curl -fsSL https://watchpost-ops.github.io/agent-install.sh | sudo sh -s -- --system

The --system route installs the binary to /usr/local/bin/watchpost-agent and invokes the canonical Go service installer. The agent runs as a systemd system unit under a dedicated unprivileged watchpost-agent account with /var/lib/watchpost-agent data:

sudo watchpost-agent service install
# Optional install flags:
#   --host HOST
#   --port PORT
#   --listen HOST:PORT
#   --env-file FILE
sudo watchpost-agent service install --host 127.0.0.1 --port 7405
sudo watchpost-agent service start
sudo watchpost-agent service stop
sudo watchpost-agent service restart
watchpost-agent service status
watchpost-agent service logs
sudo watchpost-agent service uninstall

Boot and recovery

Both the Watchpost server and Agent run as systemd system units (WantedBy=multi-user.target), so they start at boot without any user login and without systemd lingering. The unit records the absolute path of its executable at install time; moving or deleting that binary breaks the service until you reinstall.

Reverse proxy boundary

Keep Watchpost on loopback and terminate HTTPS at a reviewed reverse proxy. Preserve the original host and scheme, apply request-size and timeout limits, and do not expose health or diagnostics more broadly than intended.

Backups

Stop Watchpost before copying its SQLite data directory in this development version. A filesystem copy taken during writes is not a supported online backup. Test restoration into a separate directory before relying on a backup.

Upgrades

Database migrations run at startup. Before any future production upgrade, preserve the old binary and a tested backup, then verify startup, authentication, post counts, evidence counts, and representative history queries.

Fleet deployment

Each paired Watchpost remains independently useful and holds a separate secret. Pairing is not a reason to expose the federation endpoint publicly without TLS, network policy, rate control, and key-rotation procedures.

Current limit

No public release, supported online backup, guaranteed upgrade path, or complete internet-facing hardening claim exists yet. See Verification and hardening for the exercised gates and their boundaries.