spatie/laravel-backup-server
Securely store and manage backups from multiple Laravel apps on a dedicated backup server. Built on spatie/laravel-backup, it automatically receives and organizes incoming backups, with setup and docs tailored for Laravel deployments.
Source and Destination enables customization via migrations, policies, or observers.filesystem config (e.g., S3, local disks, NFS). Cloud storage compatibility (e.g., S3, GCS) is supported but may introduce latency or cost for frequent backups.mysqldump, pg_dump) via pre_backup_commands. This is a critical gap for full-stack backups.| Risk Area | Mitigation Strategy |
|---|---|
| SSH Key Management | Use Laravel Forge, Envoyer, or HashiCorp Vault for secure key rotation. |
| Storage Costs | Monitor used_storage via backup-server:list and set retention policies. |
| Backup Corruption | Implement checksum validation (e.g., rsync --checksum) in post_backup_commands. |
| Performance Bottlenecks | Test with backup_size_calculation_timeout_in_seconds for large backups. |
| Vendor Lock-in | Abstract Source/Destination logic via interfaces for future migration. |
| Notification Spam | Use pause_notifications_until for non-critical failures (e.g., transient SSH issues). |
rsync or a custom script?filesystem drivers (must use local for hard links).schedule:run (cron) for automated backups.pg_dump, mysqldump) via pre_backup_commands.backup-server:list data.rsync performance and storage growth.backup-server:dispatch-backups.pause_notifications_until to suppress alerts during transition.backup-server:find-files and manual restores.| Component | Compatibility Notes |
|---|---|
| Laravel Version | Tested on Laravel 8+. May require adjustments for Laravel 9+ (e.g., dependency updates). |
| PHP Version | PHP 8.0+ (hard links require PHP-FPM or CLI). |
| Storage Drivers | Only local driver supports hard links. S3/GCS will store full copies. |
| SSH Access | Sources must allow passwordless SSH from the Laravel server. |
| Existing Backups | No migration tool—backups must be manually copied to the new destination. |
Sources (SSH details, includes/excludes, commands).Destinations (disk name, retention rules).backup-server:backup <source> manually for each source.backup-server:list and find-files.backup-server:dispatch-backups via Laravel’s scheduler.backup-server:cleanup <source>).backup-server:list into dashboards (e.g., Grafana).UnhealthySourceFoundNotification.backup-server:cleanup to manage retention.backup-server:list --sortBy=healthy to identify failing sources.config/backup-server.php for changes (e.g., notification channels).php artisan config:cache) for performance.spatie/laravel-backup (this package’s dependency).storage/logs/laravel.log) for backup failures.backup-server:backup <source> --verbose for debug output.whoami access.includes/excludes paths for typos.rsync options (e.g., --compress, --bwlimit) in pre_backup_commands.backup_size_calculation_timeout_in_seconds for large backups.used_storage and alert on thresholds (e.g., 80% capacity).| Failure Scenario | Impact | Mitigation | |--------------------------------
How can I help you explore Laravel packages today?