Skip to content

Deploying the review server

Docker

Images for linux/amd64 and linux/arm64 are published on every release:

docker run -d --name peitho -p 8790:8790 -v peitho-data:/data \
  -e PEITHO_URL=https://slides.example.com \
  -e PEITHO_OIDC_ISSUER=https://accounts.google.com \
  -e PEITHO_OIDC_CLIENT_ID=... -e PEITHO_OIDC_CLIENT_SECRET=... \
  -e PEITHO_ALLOWED_DOMAINS=example.com -e PEITHO_ADMINS=you@example.com \
  ghcr.io/mmornati/peitho:latest

The image is distroless and runs as a non-root user. Data (decks, versions, comments, tokens) lives in the /data volume. Settings are environment variables (see auth.md for the sign-in ones):

Variable Default Meaning
PEITHO_ADDR 0.0.0.0:8790 listen address
PEITHO_DATA /data data folder
PEITHO_DATABASE_URL PostgreSQL URL: store everything in PostgreSQL instead of the data folder
PEITHO_URL public URL (required with sign-in)
PEITHO_WEBHOOKS webhook URLs for notifications, comma-separated (see review.md)
PEITHO_WEBHOOK_SECRET signs JSON webhook payloads
PEITHO_INSECURE_NO_AUTH 1 to run without sign-in on a public address: only for a trusted network

The container has a health check (peitho health, which calls /healthz).

To try it on your machine without sign-in:

docker run --rm -p 8790:8790 -e PEITHO_INSECURE_NO_AUTH=1 ghcr.io/mmornati/peitho

Docker Compose with HTTPS

deploy/docker-compose.yml runs Peitho behind Caddy, which gets a Let's Encrypt certificate for your host name:

cd deploy
cp peitho.env.example peitho.env    # fill it in
PEITHO_HOST=slides.example.com docker compose up -d

Use https://slides.example.com/auth/callback as the redirect URI of the OAuth client.

Without Docker

Download a binary from the releases (or go install github.com/mmornati/peitho/cmd/peitho@latest) and run peitho serve with the same flags or variables, behind any reverse proxy that terminates HTTPS.

PostgreSQL

By default the server keeps its data in files, so one instance per data folder. Set PEITHO_DATABASE_URL (or --database) to keep decks, versions, comments, sign-in tokens and the session key in PostgreSQL instead:

PEITHO_DATABASE_URL='postgres://peitho:secret@db:5432/peitho?sslmode=require' peitho serve
  • Several instances can then share the database behind a load balancer: sign-ins, tokens and MCP clients work on every instance. Writes are serialized by a PostgreSQL advisory lock, which is plenty for review traffic.
  • Peitho creates its tables (peitho_decks, peitho_versions, peitho_reviews, peitho_blobs) on start; the user needs the right to create tables in its schema the first time. Use search_path in the URL to pick a schema.
  • Tested in CI with PostgreSQL 18.
  • Prefer the environment variable to the flag: a password on the command line shows in ps. The startup banner prints only the host and database.

The Compose example has a PostgreSQL service you can turn on: uncomment it and set PEITHO_DATABASE_URL in peitho.env.

Backups

With files, everything is in the data folder: copy it (or the Docker volume) while the server runs. Files are written atomically. With PostgreSQL, back up the database as usual (pg_dump).