Laravel Database Backups: The Complete Guide

If you're running a Laravel application in production, you need database backups. It's not a question of if something will go wrong — it's when. A failed deployment, a bad migration, or a simple human error can wipe out your data in seconds.

Calm Backup was built with Laravel developers in mind. It integrates seamlessly with your existing workflow and uses familiar tools like Composer and Artisan.

Installation

Install the Calm Backup package via Composer:

composer require calmbackup/backup

Then run the Laravel-specific installer:

php artisan backup:install

This command will:

Publish the configuration file to config/backup.php

Prompt you for your Calm Backup API key

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

Generate a unique encryption key stored locally

Running Your First Backup

Once installed, run your first backup with:

php artisan backup:run

You'll see output confirming the backup was created, encrypted, and uploaded. The entire process typically takes just a few seconds for databases under 1GB.

Scheduling Automated Backups

Add the backup command to your Laravel scheduler in routes/console.php:

use Illuminate\Support\Facades\Schedule;

Schedule::command('backup:run')->daily();

That's all it takes. Your database will be backed up every day automatically. For mission-critical applications, you might want hourly backups:

Schedule::command('backup:run')->hourly();

Monitoring Backup Health

Calm Backup includes missed backup detection. If your scheduled backup doesn't arrive within the expected window, you'll receive an email notification. This protects against silent failures — like a broken cron daemon or a misconfigured scheduler.

You can also monitor your backup status from the Calm Backup dashboard, which shows your backup history, storage usage, and the timestamp of your last successful backup.

Supported Database Drivers

Calm Backup supports all major Laravel database drivers:

MySQL / MariaDB — Full mysqldump support with optimized flags

PostgreSQL — Uses pg_dump for reliable exports

SQLite — Direct file copy with integrity verification

Security by Default

Every backup is encrypted using AES-256-GCM before leaving your server. The encryption key is generated during installation and stored in your .env file. Calm Backup's servers never have access to your encryption key or your raw data.

This zero-knowledge architecture means your data is protected even if our infrastructure were compromised.

Get Started

Adding automated backups to your Laravel app takes less than two minutes. Install the package, run the Artisan command, and schedule it. That's it — your database is protected.

composer require calmbackup/backup
php artisan backup:install
php artisan backup:run

Visit calmbackup.com to create your account and get your API key.