laravel-backup is a free, open source cloud infrastructure management project written in PHP and released under MIT. It has 6,026 GitHub stars, 784 forks and 0 open issues, and was last pushed 4 days ago. On this registry it ranks #35 of 70 tracked projects in Cloud Infrastructure Management, with 5 head-to-head comparisons available.

What is laravel-backup?

laravel-backup is an MIT-licensed PHP package from Spatie that packages a Laravel application's files and its database dump into a single zip archive and stores that archive on any filesystem Laravel is configured to use, and it is aimed at Laravel developers and operations teams who want automated, verifiable, self-hosted backups without a separate backup service.

What it is

laravel-backup is a Composer package for the Laravel ecosystem, published under the name spatie/laravel-backup and installed into a Laravel application like any other dependency. It produces backups rather than storing them itself: the package assembles a zip file containing all files in the directories the application specifies, together with a dump of its database, and then hands that zip to Laravel's filesystem layer. Because the destination is a Laravel filesystem, the same package can write to local disk, S3-compatible object storage, or any other disk the application has configured, and it can write to several of them at once.

The concrete problem it solves is the routine of dumping a database and archiving application directories by hand. Instead of hand-rolled scripts that run mysqldump and then tar or copy files, the package provides a single Artisan command, php artisan backup:run, that produces one consistent zip containing both the file tree and the database dump. It also addresses the two operational gaps that hand-written backup scripts usually leave open: knowing whether backups actually succeeded, and preventing old archives from filling up the destination disk.

Key capabilities

  • Creates a zip file containing all files in the directories you specify plus a dump of your database, triggered with php artisan backup:run.
  • Stores backups on any filesystem configured in Laravel, and can write to multiple filesystems simultaneously for redundancy.
  • Ships a backup monitor that checks the health of existing backups, exposed through the package's monitoring documentation.
  • Sends notifications through several channels when a problem with a backup is detected.
  • Cleans up old backups automatically to avoid consuming excessive disk space.
  • Requires PHP 8.4 and Laravel 12.0 or higher for the current version, with older releases documented for versions 3 through 6.
  • Includes a test suite run with composer test, and the repository shows 6,026 stars and 784 forks.

Who uses it and how

  • Laravel application teams schedule php artisan backup:run so file and database backups are produced on a recurring basis without manual intervention.
  • Teams that need redundancy point a single backup run at several configured filesystems at once, so one copy lands locally and another on remote object storage.
  • Operations staff rely on the backup monitor and notification channels to learn about failing or missing backups rather than discovering the gap during a restore.
  • Projects pinned to PHP below 8.4 or Laravel below 12.0 run versions 3 through 6, which receive bug fixes but no new features.
  • Long-lived Laravel applications use the cleanup behaviour to keep disk usage bounded as the number of retained archives grows.

Getting started

Install the spatie/laravel-backup package through Composer in a Laravel application, then take a backup by running php artisan backup:run. Configuration, monitoring, notification and cleanup details live in the documentation at https://spatie.be/docs/laravel-backup.

How it compares

The facts provided do not list paid products that this package replaces, and they name no comparable backup tool. Within the material supplied here, laravel-backup stands alone in this registry.

When to use it — and when not to

A self-hoster must already operate a Laravel application with PHP 8.4 and Laravel 12.0 or higher, at least one configured filesystem to receive the archives, a scheduler to trigger runs, and whatever notification channels are wanted for alerts; database connectivity is obviously required for the dump step. It is the wrong choice for applications outside Laravel or PHP, and for teams unwilling to keep pace with the PHP and Laravel versions the current release demands, since versions 6 and below are frozen feature-wise and receive bug fixes only. The README itself is largely a pointer to external documentation at spatie.be, so anyone evaluating the package must read those pages before deciding.

project readme (upstream, from github) — read inline
Logo for Laravel Backup
</a>

A modern backup solution for Laravel apps

Latest Stable Version MIT Licensed GitHub Tests Action Status Quality Score Total Downloads

This Laravel package creates a backup of your application. The backup is a zip file that contains all files in the directories you specify along with a dump of your database. The backup can be stored on any of the filesystems you have configured in Laravel.

Feeling paranoid about backups? No problem! You can backup your application to multiple filesystems at once.

Once installed taking a backup of your files and databases is very easy. Just issue this artisan command:

php artisan backup:run

But we didn't stop there. The package also provides a backup monitor to check the health of your backups. You can be notified via several channels when a problem with one of your backups is found. To avoid using excessive disk space, the package can also clean up old backups.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation and usage

This package requires PHP 8.4 and Laravel 12.0 or higher. You'll find installation instructions and full documentation on https://spatie.be/docs/laravel-backup.

Using an older version of PHP / Laravel?

If you are on a PHP version below 8.4 or a Laravel version below 12.0 just use an older version of this package.

Read the extensive documentation on version 3, on version 4, on version 5 and on version 6. We will not be introducing any new features to v6 and below. We will however continue to update for bugs as neccesary.

Testing

Run the tests with:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards on our company website.

Credits

Special thanks to Caneco for the original logo.

License

The MIT License (MIT). Please see License File for more information.

Frequently asked questions

Is laravel-backup free to use?

laravel-backup is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does laravel-backup do?

A package to backup your Laravel app

What is laravel-backup written in?

laravel-backup is primarily written in PHP. Its source is publicly available at https://github.com/spatie/laravel-backup, and it has 6,026 GitHub stars.