Backup Strategies
Regular, tested backups are the most important operational practice for a self-hosted platform. This page summarizes backup approaches for each platform component.
What this page covers
- Backup requirements per service
- Docker volume backup approach
- K3s persistent volume backup with Longhorn snapshots
- Off-site backup with Restic
- Backup testing: how to verify your backups work
Per-service backup summary
| Service | What to back up | Backup method |
|---|---|---|
| Gitea | Data volume (repos, attachments), PostgreSQL DB | gitea dump, pg_dump |
| YouTrack | Data volume (includes DB backup) | YouTrack admin UI backup, volume copy |
| Prometheus | Metrics data (optional — metrics are transient) | Longhorn snapshot or skip |
| Grafana | Dashboard JSON exports, config | Grafana API export |
Docker volume backup
# Back up a named Docker volume to a tarball
docker run --rm \
-v <volume-name>:/data:ro \
-v /backup:/backup \
alpine tar czf /backup/<service>-$(date +%Y%m%d).tar.gz /data
Longhorn snapshots (K3s track)
Longhorn supports recurring snapshot schedules and backup to S3-compatible storage. Configure via the Longhorn UI under Volume > Recurring Jobs.
Off-site backup with Restic
Restic is a fast, encrypted backup tool that supports many backends (S3, B2, SFTP):
restic -r s3:s3.amazonaws.com/mybucket/backups backup /backup