Skip to content

Deployment

Kristian Buriasco edited this page Jul 16, 2026 · 1 revision

Deployment

Docker (recommended)

See Quick Start for first boot. Day-to-day:

docker compose pull && docker compose up -d

Migrations run on boot after backing up the DB. The admin panel badges newer releases (opt out with DISABLE_UPDATE_CHECK=1).

Prebuilt image: ghcr.io/kristian-buriasco/albm — pin a version in production, not :latest.

Health check

GET /api/health → { ok: true } when the database is readable.

  • Point Uptime Kuma / Home Assistant at it (HTTP 200 healthy, 500 if the DB is down).
  • The container HEALTHCHECK uses the same endpoint.

HTTPS / reverse proxy

Terminate TLS in front of the app (Caddy, nginx, Nginx Proxy Manager, …). Passkeys (WebAuthn) need a secure origin and a correct BASE_URL.

Bare metal (no Docker)

npm ci && npm run build
cp -r .next/static .next/standalone/.next/static
SESSION_SECRET=… BASE_URL=… DATA_DIR=/var/lib/gallery/data node .next/standalone/server.js

Templates in deploy/:

  • gallery.service — systemd unit
  • update.sh — update helper

Rebuild native modules for the host (npm rebuild). On older toolchains that cannot compile better-sqlite3 v12, pin better-sqlite3@11.10.0 (already pinned in the project).

Backups

Back up the whole DATA_DIR volume (database + photos). Automatic migration snapshots go to DATA_DIR/backups/ before schema changes; treat those as a safety net, not your only backup.

Related

Clone this wiki locally