Skip to main content
Runs pg_dump, optionally compresses and encrypts the output, and streams it directly to your configured storage provider. You’ll see real-time progress:

Options

OptionDescription
--encryptForce encryption on (overrides config)
--no-encryptForce encryption off (overrides config)
--compressForce compression on (overrides config)
--no-compressForce compression off (overrides config)
--encryption-key <key>Use a specific 64-char hex key for this backup
--compression-level <1-11>zstd compression level (default 6)

Examples

Standard backup

Uses everything from your config file:

Force maximum compression

Useful for archival backups where you’ll keep them for months.

Fast backup, no compression

When your storage is cheap and restore speed matters more than size.

One-off with explicit encryption key

Overrides DBDOCK_ENCRYPTION_SECRET just for this run.

Backup formats

The format comes from dbdock.config.json:
FormatExtensionNotes
custom (default).sqlBinary, pg_dump’s native compression, selective restore
plain.sqlHuman-readable SQL, works with psql directly
directory.dirParallel dump support for huge DBs
tar.tarTar archive of directory format
See Concepts → backup formats for when to pick which.

What happens under the hood

  1. Connect — validates database credentials
  2. Dump — runs pg_dump with your configured format
  3. Compress (if enabled) — zstd at configured level
  4. Encrypt (if enabled) — AES-256-GCM with key derived from secret
  5. Upload — streams to your storage provider, no temp files
  6. Record metadata — size, duration, flags, storage key
  7. Send alerts (if configured) — Slack/email
  8. Retention (if runAfterBackup: true) — cleanup old backups

After the backup

Generating an encryption key

Store the output in .env as DBDOCK_ENCRYPTION_SECRET. See Security for key management.