Backup and Restore
May 5, 2026 · View on GitHub
Create Backup
./scripts/backup.sh
What's Included
- PostgreSQL database dump
- CLIProxyAPI configuration
- OAuth token storage
- Environment files
- TLS certificates
Storage Location
Backups are stored in backups/cliproxyapi_backup_YYYYMMDD_HHMMSS.tar.gz
Restore from Backup
./scripts/restore.sh backups/cliproxyapi_backup_20260206_020000.tar.gz
The restore script will:
- Stop all services
- Restore database from dump
- Restore configuration files
- Restore volumes
- Restart services
Automated Backups
Configured during installation via cron:
- Daily: 2 AM every day, keeps last 7 backups
- Weekly: 2 AM every Sunday, keeps last 4 backups
View cron schedule:
sudo crontab -l
View backup logs:
tail -f backups/backup.log
Dashboard Scheduled Backups
The dashboard itself also supports scheduled database snapshots, separate from the host-level backups above. They are managed from Settings → Backup and run via the backup-scheduler container.
See CONFIGURATION.md → Scheduled Backups for setup, the required BACKUP_SCHEDULER_KEY, and the upgrade path for existing deployments.