Skip to main content
DBDock can be configured via dbdock.config.json, environment variables, or a mix of both. Secrets always live in environment variables — never in the config file.
Security-first. Passwords, API keys, webhooks, and encryption secrets must be set via environment variables. The config file is designed to be committed to your repository; the .env file is designed not to be.

Config file structure

dbdock.config.json has four top-level sections:

Database

Set DBDOCK_DB_URL or DATABASE_URL to a full PostgreSQL URL. When present, it overrides anything in dbdock.config.json.

Option 2 — Config file with password in env

Password comes from DBDOCK_DB_PASSWORD.

Option 3 — .pgpass

For host-level credential isolation, use PostgreSQL’s .pgpass file:
DBDock uses .pgpass automatically when present.

Storage

Pick one provider. Each has its own dedicated page with setup instructions:

Local

Filesystem storage for single-server setups.

AWS S3

S3 or any S3-compatible service.

Cloudflare R2

Zero-egress object storage.

Cloudinary

Media platform with generous free tier.

Backup

Encryption key is read from DBDOCK_ENCRYPTION_SECRET. Generate a key:

Alerts

See the dedicated alert pages for setup:

Email

SMTP via Gmail, SendGrid, SES, Mailgun, or any provider.

Slack

Incoming webhooks.

Environment variables reference

DBDock reads from both .env and .env.local. .env.local takes priority.

Database

Storage

Encryption

Alerts

Runtime

Strict mode

Set DBDOCK_STRICT_MODE=true to enforce environment-only secrets. DBDock will refuse to load any configuration where a secret appears in the config file, preventing accidental commits. Recommended for CI and production.

Config migration

If you have secrets in dbdock.config.json from an older version:
DBDock moves them to .env, cleans up the config file, and updates .gitignore. See migrate-config.