Skip to main content

Setup your development

Learn how to set up DBdocks locally and start managing your backups.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js 18 or higher
  • PostgreSQL 12 or higher
  • PostgreSQL client tools (pg_dump, pg_restore, psql)
macOS
brew install postgresql
Ubuntu/Debian
sudo apt-get install postgresql-client
Windows Download from PostgreSQL Downloads

Initialize DBdocks

Run the interactive setup wizard to create your configuration file.
npx dbdock init
This command will guide you through:
  1. Database connection: Host, port, credentials.
  2. Storage provider: Local, S3, R2, or Cloudinary.
  3. Encryption/Compression: Security settings.
  4. Email and Slack alerts: Optional notification settings.
It will automatically create a dbdock.config.json file and add it to your .gitignore.

Create a Backup

Once initialized, you can create your first backup immediately.
npx dbdock backup
You will see a real-time progress bar as your database is backed up, compressed, encrypted, and uploaded to your chosen storage.
████████████████████ | 100% | 45.23/100 MB | Speed: 12.50 MB/s | ETA: 0s | Uploading to S3
✔ Backup completed successfully

Restore a Backup

Restoring is just as easy. Run the restore command to see a list of available backups.
npx dbdock restore
Select the backup you want to restore, and DBdocks will handle the download, decryption, decompression, and restoration process.
Progress:
────────────────────────────────────────────────────────
  ✔ Downloading backup
  ✔ Decrypting data
  ✔ Decompressing data
  ⟳ Restoring to database...
────────────────────────────────────────────────────────
✔ All steps completed in 8.42s