Skip to main content
Docker Compose is the recommended way to run Atrium in production. The official docker-compose.yml starts a PostgreSQL container alongside Atrium and wires them together automatically.

Generate a secret

Before you start, generate a value for BETTER_AUTH_SECRET:
Keep this value — you’ll need it in the next step. It must be at least 32 characters and should be treated like a password.

Built-in database

The default configuration starts Atrium with a dedicated PostgreSQL 16 container.
Save this as docker-compose.yml, then start Atrium:
Open http://localhost:8080 and create your account.
You can also put BETTER_AUTH_SECRET and POSTGRES_PASSWORD in a .env file next to your docker-compose.yml so you don’t have to pass them on the command line every time.

External database

If you already have a PostgreSQL instance, skip the bundled postgres service and point Atrium at your existing database:
The database schema is applied automatically on startup. If your connection goes through a pooler like PgBouncer, set SKIP_DB_PUSH=true and add a DIRECT_URL pointing to a non-pooled connection. See Docker for details.

Volume mounts

Docker manages these as named volumes. The data lives on your host under Docker’s volume directory and persists across container restarts and image updates.

Starting and stopping

docker compose down -v deletes your named volumes, including the database and uploaded files. Only run this if you intend to wipe all data.

Adding more environment variables

For the full list of environment variables (storage, email, Stripe, rate limiting, and more), see Docker.