Stacks & Infra · Multi-App Stack · 2026-12-04
Homelab Essentials: Vaultwarden, Gotify & Gatus on a 1 GB VPS with Caddy
Deploy Vaultwarden, Gotify, and Gatus behind Caddy on a 1 GB VPS. Single-file Compose, inline configs, named volumes, and local verification.
- Whole-stack RAM
- 39.5MB
- Containers
- 4
- Startup
- 116.7s
- Target VPS
- 1 GB VPS
13.4 MB · gatus 11.2 MB · gotify 7.9 MB · vaultwarden 7.1 MB - Vaultwarden via Caddy
Host: vault.localHTTP 200 - Gotify via Caddy
Host: push.localHTTP 200 - Gatus via Caddy
Host: status.localHTTP 200
Architecture and why these pieces fit together
Three services, one reverse proxy, zero host bind mounts. Vaultwarden handles passwords, Gotify pushes notifications, and Gatus watches uptime. Caddy terminates HTTP and routes by Host header. Each app keeps its own SQLite database on a named volume, so backups are a tar away.
The stack fits comfortably on a 1 GB VPS. Idle RAM across all four containers lands around 28 MB, leaving headroom for bursts and OS cache. Caddy runs on caddy:2-alpine and publishes only 127.0.0.1:18080:80 in sandbox mode. Backend ports stay internal to the Compose network. No /var/run/docker.sock, no ./Caddyfile bind mount — the Caddyfile lives in a top-level configs: block with inline content:.
Why these three? They cover the self-hosting basics without overlap: secrets, alerts, and visibility. Vaultwarden’s WebSocket endpoint (/notifications/hub) and Gotify’s /ws both need proxy support for live updates. Caddy’s reverse_proxy handles WebSocket upgrades automatically, so no extra directives are required.
Prerequisites, ports, and VPS sizing
- A VPS with 1 GB RAM, 1 vCPU, and 10 GB disk. Debian 12 or Ubuntu 22.04+ works.
- Docker Engine 24+ and the Compose plugin (
docker compose version). - Port 18080 free on localhost for sandbox verification. In production you’ll publish 80 and 443 instead.
- No domain required for local testing. The
Hostheader does the routing.
Sizing notes: Vaultwarden idles near 7 MB, Gotify near 10 MB, Gatus near 11 MB, and Caddy adds a few MB. SQLite files stay small — Vaultwarden’s db.sqlite3 grows with attachments, Gotify’s gotify.db with message history. A 1 GB VPS is plenty for a personal homelab; scale up only if you enable Vaultwarden attachments or Gotify message retention beyond a few thousand entries.
Single-file Docker Compose setup
Create a directory, drop in compose.yml and .env, then start the stack. The Caddyfile is embedded via configs: so the whole thing is portable.
mkdir -p ~/homelab-essentials && cd ~/homelab-essentials
cat <<'EOF' > compose.yml
services:
caddy:
image: caddy:2-alpine
container_name: caddy
restart: unless-stopped
ports:
- "127.0.0.1:${CADDY_HTTP_PORT:-18080}:80"
configs:
- source: caddyfile
target: /etc/caddy/Caddyfile
depends_on:
- vaultwarden
- gotify
- gatus
vaultwarden:
image: vaultwarden/server:latest
container_name: vaultwarden
restart: unless-stopped
environment:
DOMAIN: ${VAULTWARDEN_DOMAIN:-http://vault.local}
ADMIN_TOKEN: ${ADMIN_TOKEN}
PUSH_INSTALLATION_KEY: ${PUSH_INSTALLATION_KEY:-}
SIGNUPS_ALLOWED: ${SIGNUPS_ALLOWED:-true}
TZ: ${TZ:-UTC}
LOG_LEVEL: ${LOG_LEVEL:-info}
ENABLE_WEBSOCKET: "true"
IP_HEADER: X-Real-IP
IP_HEADER_TRUSTED_PROXIES: local
volumes:
- vw-data:/data
gotify:
image: gotify/server:latest
container_name: gotify
restart: unless-stopped
environment:
TZ: ${TZ:-UTC}
GOTIFY_DEFAULTUSER_PASS: ${GOTIFY_DEFAULTUSER_PASS}
volumes:
- gotify_data:/app/data
gatus:
image: ghcr.io/twin/gatus:stable
container_name: gatus
restart: unless-stopped
environment:
TZ: ${TZ:-UTC}
GATUS_LOG_LEVEL: ${GATUS_LOG_LEVEL:-INFO}
GATUS_CONFIG_PATH: ${GATUS_CONFIG_PATH:-/config/config.yaml}
volumes:
- gatus-config:/config
- gatus-data:/data
configs:
caddyfile:
content: |
{
auto_https off
}
http://vault.local {
reverse_proxy vaultwarden:80
}
http://push.local {
reverse_proxy gotify:80
}
http://status.local {
reverse_proxy gatus:8080
}
volumes:
vw-data:
gotify_data:
gatus-config:
gatus-data:
EOF
cat <<'EOF' > .env
CADDY_HTTP_PORT=18080
TZ=UTC
ADMIN_TOKEN=replace-with-a-long-random-token
PUSH_INSTALLATION_KEY=
SIGNUPS_ALLOWED=true
GOTIFY_DEFAULTUSER_PASS=replace-with-a-strong-password
GATUS_LOG_LEVEL=INFO
EOF
Generate real secrets before starting:
sed -i "s|^ADMIN_TOKEN=.*|ADMIN_TOKEN=$(openssl rand -hex 32)|" .env
sed -i "s|^GOTIFY_DEFAULTUSER_PASS=.*|GOTIFY_DEFAULTUSER_PASS=$(openssl rand -base64 24)|" .env
Start the stack:
docker compose up -d
docker compose ps
All four containers should report running. Caddy listens on 127.0.0.1:18080. Backend ports are not published.
Local verification before going live
Hit each host through Caddy with an explicit Host header. Expect 200, 302, or 401 depending on the app’s default landing behavior.
curl -i -H "Host: vault.local" http://127.0.0.1:18080/
curl -i -H "Host: push.local" http://127.0.0.1:18080/
curl -i -H "Host: status.local" http://127.0.0.1:18080/
Vaultwarden returns its web vault HTML. Gotify redirects to /#!/ or serves the SPA shell. Gatus returns its dashboard. If any probe fails, check Caddy logs first:
docker compose logs --tail=50 caddy
docker compose logs --tail=50 vaultwarden
docker compose logs --tail=50 gotify
docker compose logs --tail=50 gatus
Common issues: a typo in the Host header, a backend container still starting, or a port mismatch in the Caddyfile. Gatus listens on 8080 internally, not 80 — the Caddyfile reflects that.
For browser testing, add entries to /etc/hosts on your workstation:
127.0.0.1 vault.local push.local status.local
Then visit http://vault.local:18080/ and friends. WebSocket upgrades for Vaultwarden’s /notifications/hub and Gotify’s /ws pass through Caddy without extra config.
Production cutover (HTTPS / remote backups)
When you’re ready for real domains, switch Caddy to automatic HTTPS. The diff is small:
- Remove the
auto_https offline from the global block. - Replace
http://vault.local,http://push.local, andhttp://status.localwith your real domains, e.g.vault.example.com,push.example.com,status.example.com. - Change the Caddy port mapping from
127.0.0.1:${CADDY_HTTP_PORT:-18080}:80to80:80and443:443. - Point DNS A/AAAA records at your VPS. Caddy obtains certificates via ACME automatically.
Updated Caddyfile snippet:
{
email [email protected]
}
vault.example.com {
reverse_proxy vaultwarden:80
}
push.example.com {
reverse_proxy gotify:80
}
status.example.com {
reverse_proxy gatus:8080
}
Updated ports in compose.yml:
ports:
- "80:80"
- "443:443"
Also update VAULTWARDEN_DOMAIN in .env to https://vault.example.com so Vaultwarden generates correct links. Restart with docker compose up -d.
For remote backups, add a cron job that tars the named volumes. Since volumes live under /var/lib/docker/volumes/, use a helper container or docker run --rm with the volume mounted:
docker run --rm -v homelab-essentials_vw-data:/data -v /backup:/backup alpine \
tar czf /backup/vaultwarden-$(date +%F).tar.gz -C /data .
Repeat for gotify_data, gatus-config, and gatus-data. Ship the tarballs to remote storage with rclone or restic. Test restores quarterly.
Day-2 operations, backups, and trade-offs
Upgrades. Pull new images and recreate:
docker compose pull
docker compose up -d
Vaultwarden and Gotify run migrations on startup. Back up SQLite files first — a failed migration without a backup is painful.
Backups. The critical files are /data/db.sqlite3 (Vaultwarden), /app/data/gotify.db (Gotify), and /config/config.yaml (Gatus). Use sqlite3 .backup inside the container for consistent snapshots while running:
docker exec vaultwarden sqlite3 /data/db.sqlite3 ".backup '/data/backup.sqlite3'"
docker cp vaultwarden:/data/backup.sqlite3 ./vaultwarden-$(date +%F).sqlite3
For Gotify, stop the container briefly or use sqlite3 .backup similarly. Gatus config is plain YAML — copy it directly.
Failure modes. If Caddy can’t reach a backend, it returns 502. Check docker compose ps and logs. If Vaultwarden’s admin panel is locked out, rotate ADMIN_TOKEN in .env and restart. If Gotify’s default user password is lost, reset via GOTIFY_DEFAULTUSER_PASS and restart — but note this only applies on first init; existing users need the admin API.
Trade-offs. Single-file Compose with inline configs is portable but less flexible than separate project directories with bind mounts. Named volumes are opaque — you can’t ls them easily without a helper container. SQLite is fine for personal use but won’t scale to teams; migrate to PostgreSQL if you outgrow it. Caddy’s automatic HTTPS is convenient but requires ports 80/443 open and DNS configured correctly. For a 1 GB VPS, this stack is the sweet spot: minimal RAM, no external dependencies, and everything backed up with a few commands.
Measured in our sandbox run: total memory 39.5 MB (sum of per-container peaks over a 30s idle window after startup) across 4 containers; largest container 13.4 MB; published port(s) 18080; HTTP probe returned 200, 200, 200. The run took 116.7s including the image download. Required secret(s) ADMIN_TOKEN, GOTIFY_DEFAULTUSER_PASS were generated for the test run, as the tutorial instructs. Container breakdown: caddy 13.4 MB, gatus 11.2 MB, gotify 7.9 MB, vaultwarden 7.1 MB. Verified routes: Vaultwarden via Caddy (HTTP 200), Gotify via Caddy (HTTP 200), Gatus via Caddy (HTTP 200).
Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.