Step-by-Step: How to Back Up Your Application Database with Calm Backup

This guide walks you through setting up Calm Backup from scratch. By the end, you'll have automated, encrypted database backups running daily — and it takes about five minutes.

What You'll Need

A PHP application with a database (MySQL, PostgreSQL, or SQLite)

Composer installed on your server

Terminal access to your server

Step 1: Create Your Calm Backup Account

Head to calmbackup.com and create an account. You just need your name, email, and a password.

After registering, you'll land on your dashboard where your API key is displayed.

Step 2: Copy Your API Key

Your API key is shown at the top of the dashboard. Click the Copy button to copy it to your clipboard — you'll need it in the next step.

Your API key connects your server to your Calm Backup account. Keep it private — treat it like a password.

Step 3: Install the Package

SSH into your server and navigate to your project directory. Then install the Calm Backup package via Composer:

composer require calmbackup/backup

This adds the backup tool to your project without changing any of your existing code.

Step 4: Initialize the Configuration

Run the init command to set up your backup configuration:

vendor/bin/calmbackup init

This command will:

Ask for your API key (paste the key you copied in Step 2)

Auto-detect your database driver (MySQL, PostgreSQL, or SQLite)

Generate a local encryption key for AES-256-GCM encryption

Save the configuration to your project

For Laravel projects, you can use the Artisan installer instead:

php artisan backup:install

This does the same thing but also publishes a Laravel config file to config/backup.php.

Step 5: Run Your First Backup

Now run your first backup:

vendor/bin/calmbackup run

Or for Laravel:

php artisan backup:run

Here's what happens automatically behind the scenes:

Your database is exported (using mysqldump, pg_dump, or direct file copy for SQLite)

The export is encrypted locally using your AES-256-GCM key

A checksum is generated for integrity verification

The encrypted file is uploaded to Calm Backup's secure storage over TLS

The temporary plaintext export is securely deleted

The entire process takes seconds for most databases. You'll see a confirmation in your terminal when it's done.

Step 6: Verify on Your Dashboard

Head back to your Calm Backup dashboard. You should see your backup stats update:

And your backup will appear in the backup history with its date, size, database driver, and confirmation status:

Every backup shows a green Confirmed status once it's been received and verified.

Step 7: Set Up Automated Daily Backups

You don't want to run backups manually every day. Set up a cron job to automate it.

Using Cron Directly

Add this to your crontab (crontab -e):

0 2 * * * cd /path/to/your/project && vendor/bin/calmbackup run

This runs a backup every day at 2:00 AM.

Using Laravel's Task Scheduler

If you're on Laravel, add the backup to your scheduler in routes/console.php:

use Illuminate\Support\Facades\Schedule;

Schedule::command('backup:run')->dailyAt('02:00');

Then make sure your server's crontab runs the Laravel scheduler every minute:

* * * * * cd /path/to/your/project && php artisan schedule:run >> /dev/null 2>&1

Step 8: Enable Missed Backup Alerts

Calm Backup monitors your backup schedule. If an expected backup doesn't arrive — because your cron failed, your server went down, or a deployment broke something — you'll receive an email notification automatically.

This is critical. The most dangerous backup failure is a silent one. Teams often discover their backups stopped working weeks ago, right when they need them most.

What Happens When You Need to Restore?

When disaster strikes, restoring is a single command:

vendor/bin/calmbackup restore

Or for Laravel:

php artisan backup:restore

This automatically:

Downloads the most recent encrypted backup

Verifies the checksum to ensure integrity

Decrypts the backup locally using your key

Imports the data into your database

No manual steps. No separate download-and-decrypt process. One command, full recovery.

Quick Reference

Installcomposer require calmbackup/backupInitializevendor/bin/calmbackup initInitialize (Laravel)php artisan backup:installRun backupvendor/bin/calmbackup runRun backup (Laravel)php artisan backup:runRestorevendor/bin/calmbackup restoreRestore (Laravel)php artisan backup:restore

You're Done

That's everything. Your database is now backed up daily with AES-256-GCM encryption, verified with checksums, and monitored for missed backups. Your encryption key never leaves your server — Calm Backup can't read your data even if we wanted to.

If you have questions, check the documentation or reach out to our support team.