- How do I set up a centralized backup server for multiple Laravel applications using this package?
- First, install the package on a dedicated Laravel server using `composer require spatie/laravel-backup-server`. Configure storage (e.g., S3, local, or FTP) in the server’s `.env` file. Then, each client app must install `spatie/laravel-backup` and configure the `BackupSender` to point to your server’s endpoint with API tokens for authentication.
- What Laravel versions does `laravel-backup-server` support?
- The server requires Laravel 9+ (PHP 8.0+), while client apps must use `spatie/laravel-backup` v6.x or later. Check the [README](https://github.com/spatie/laravel-backup-server) for exact compatibility details, as minor version mismatches may cause issues.
- Can I use this package for backups outside Laravel (e.g., Node.js or Python apps)?
- No, this package is Laravel-centric and relies on `spatie/laravel-backup` for client-side generation. Non-Laravel apps would need custom integrations or alternative tools like `rclone` or `duplicati` for cross-platform support.
- How do I enforce retention policies (e.g., 7-day backups) across all client apps?
- Configure retention rules in the server’s storage driver (e.g., S3 lifecycle policies or local cleanup scripts). The server itself doesn’t enforce retention—it’s handled by the storage backend. For consistency, document policies in your team’s backup SOP.
- What security measures should I implement for backup data in transit and at rest?
- Use TLS for HTTP transfers (configured via `BACKUP_SERVER_HTTPS` in client apps). Encrypt sensitive data at rest with storage-specific tools (e.g., S3 server-side encryption). For authentication, use API tokens with limited scopes or mutual TLS for stricter security.
- How do I monitor backup failures or storage limits on the server?
- The server logs backup events to Laravel’s log system. For alerts, integrate with tools like Laravel Horizon, Sentry, or a custom cron job to check storage usage. The package doesn’t include built-in monitoring, so you’ll need to extend it or use third-party solutions.
- Can I restore backups directly from the server, or do I need to download them first?
- Backups are stored as archives (e.g., ZIP) on the server. To restore, download the archive to a client app and use `spatie/laravel-backup`’s restore commands. The server doesn’t provide a web UI for direct restoration—this is a deliberate design choice to keep it lightweight.
- What’s the performance impact of sending large backups (e.g., 10GB+) to the server?
- Performance depends on network latency and storage I/O. For large backups, use incremental strategies (via `laravel-backup`) and optimize storage tiers (e.g., S3’s `STANDARD_IA` for cost savings). Test with your expected backup size to benchmark transfer times.
- How do I handle multi-region backups for disaster recovery?
- Deploy the backup server in a secondary region and configure clients to send backups to both locations. Use storage replication (e.g., S3 cross-region replication) or a load balancer to distribute traffic. Document failover procedures for the server itself.
- Are there alternatives to `laravel-backup-server` for centralized Laravel backups?
- Yes. For Laravel, consider `spatie/laravel-backup` with manual storage (e.g., S3) or third-party tools like `Backblaze B2`, `Veeam`, or `Restic`. For multi-cloud, `Velero` (Kubernetes-native) or `Duplicati` (cross-platform) may fit better if you’re not locked into Laravel.