Self-hosting
Self-hosting
Beyond the basics (deploy): Postgres, reverse proxies, backups, upgrades. Everything here is optional — SQLite + Docker is a perfectly good deployment.
Postgres
SQLite is the default and fine for solo scale. When you outgrow it — or just
prefer Postgres — set MMK_DATABASE_URL and restart; the schema is created
automatically and the API behaves identically.
# optional: add to compose
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: mmk
POSTGRES_PASSWORD: mmk
POSTGRES_DB: mmk
volumes: [pgdata:/var/lib/postgresql/data]
# and on the minmaxkey service:
# MMK_DATABASE_URL: postgresql+psycopg://mmk:mmk@db:5432/mmk
Backups
SQLite mode: /data holds the whole database — copy the file, or point
Litestream / restic / borg at the directory. Postgres mode: use pg_dump or
any Postgres-native tooling. That's the entire backup story.
Behind a reverse proxy
Put nginx/Caddy in front with TLS and set MMK_COOKIE_SECURE=true so the
dashboard cookie is only sent over HTTPS. Nothing else needs configuring.
Upgrading
Tables are created automatically on startup. There is no migration framework
yet: schema changes across versions may need manual action on an existing
database, so snapshot your data/ directory (or take a pg_dump) before
upgrading — you can always roll back.
Bare Python
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
MMK_ADMIN_TOKEN=... MMK_ADMIN_PASSWORD=... MMK_SECRET_KEY=... \
uvicorn app.main:app --host 0.0.0.0 --port 8080