Backups & Restore
Protect your data with automated backups. sh0 supports local, S3, and Cloudflare R2 storage destinations with configurable retention policies and one-click restore.
Manual Backups
You can trigger a backup at any time from the database detail page. Manual backups use the same engine-specific dump tools as scheduled backups.
- Navigate to your database within the stack.
- Click the Backups tab.
- Click Backup Now.
- Select a storage destination (or use the default).
- The backup runs in the background -- you can continue working.
sh0 uses the native dump utility for each engine to ensure consistent backups:
| Engine | Backup Tool | Format |
|---|---|---|
| PostgreSQL | pg_dump | Custom format (.dump) or SQL |
| MySQL / MariaDB | mysqldump | SQL (.sql.gz) |
| MongoDB | mongodump | BSON archive (.archive) |
| Redis | RDB snapshot | RDB file (.rdb) |
Scheduled Backups
Set up automated backups that run on a schedule. sh0 uses cron expressions for maximum flexibility.
- Open the database Backups tab.
- Click Configure Schedule.
- Enter a cron expression or select a preset (daily, every 6 hours, weekly).
- Choose the storage destination.
- Set a retention policy.
- Click Save.
Cron Expressions
Backup schedules use standard 5-field cron syntax. Here are common patterns:
# Every day at 2:00 AM
0 2 * * *
# Every 6 hours
0 */6 * * *
# Every Sunday at midnight
0 0 * * 0
# Every hour
0 * * * *
# Monday to Friday at 3:30 AM
30 3 * * 1-5Storage Destinations
Backups can be stored locally on the server or uploaded to cloud object storage. Using remote storage is strongly recommended for disaster recovery.
Local Storage
By default, backups are stored on the server's local filesystem. This is the simplest option but provides no protection against disk failure or server loss.
/var/lib/sh0/backups/<stack-name>/<database-name>/S3-Compatible Storage
sh0 supports any S3-compatible object storage provider, including AWS S3, Cloudflare R2, MinIO, Backblaze B2, and DigitalOcean Spaces.
To configure a storage provider:
- Go to Settings → Storage Providers.
- Click Add Provider.
- Enter the endpoint URL, access key, secret key, bucket name, and region.
- Click Test Connection to verify access.
- Click Save.
https://<account-id>.r2.cloudflarestorage.com.Retention
A schedule keeps a bounded number of backups for its source. The value you set is a count of backups to keep -- not a number of days. Retention only counts the backups that schedule created: manual backups are never counted and never removed, and when a source has several schedules, each one prunes only its own. The default is 7, and 0 means unlimited: backups are never removed automatically.
| Setting | Description |
|---|---|
| Retention count | How many completed scheduled backups of this source to keep. Anything beyond that count is what a purge would remove. |
| Manual backups | Never counted towards the retention count, and never deleted automatically. |
| Value of 0 or less | Disables pruning for that schedule. |
Restoring from a Backup
Restoring a backup replaces the current database contents with the backup data. sh0 handles stopping the database, restoring the data, and restarting the container.
- Open the database Backups tab.
- Find the backup you want to restore in the history list.
- Click the Restore button next to the backup.
- Confirm the restore operation in the dialog.
- Wait for the restore to complete -- the database will be temporarily unavailable.
Backup History & Status
The backup history table shows all backups for a database, including their status, size, duration, and storage location.
Each backup can have one of the following statuses:
- Completed -- Backup finished successfully and is available for restore.
- In Progress -- Backup is currently running.
- Failed -- Backup encountered an error. Click the entry to view the error message.
- Expired -- Backup was removed by the retention policy.
You can also download completed backups directly from the dashboard for offline storage or migration to another server.