Docs cipi.yml Web panel API MCP Guides Compare GitHub Telegram channel
  1. Docs
  2. Backups & monitoring
  3. Backups to S3

Backups to S3

Scheduled database and storage backups to any S3-compatible bucket.

Backups & monitoring

Backups that run on their own, go where you want, are encrypted before they leave the server, and tell you when they stop. Built on profiles: each one answers what, how often, where and how long.

Backups to S3
$ cipi backup configure
$ cipi backup profile add nightly --scope=all --cron='0 2 * * *' --keep-days=14 --dest=s3
$ cipi backup run --profile=nightly
Step 1 of 6Profile runs

Each backup profile has its own schedule (--every=30m, --cron='0 2 * * *'…). When it's due, the run starts on its own.

1. Destinations#

bash
cipi backup configure          # the default bucket ("s3"); leave empty for local-only
cipi backup destination add offsite --bucket=acme-backups --key=AKIA… --secret=… \
    --region=eu-central-1 --endpoint=https://eu-central-1.your-objectstorage.com
cipi backup destination test   # reach every bucket with its own credentials
cipi backup status [--json]    # destinations, profiles, last run, overdue, uncovered
ProviderEndpoint
AWS S3leave empty
Cloudflare R2https://<account-id>.r2.cloudflarestorage.com
Hetzner Object Storagehttps://<location>.your-objectstorage.com
DigitalOcean Spaceshttps://<region>.digitaloceanspaces.com
Backblaze B2https://s3.<region>.backblazeb2.com
Scalewayhttps://s3.<region>.scw.cloud
MinIOhttps://your-minio-host

local (/var/backups/cipi) is always available. A profile can send each run to several destinations at once.

2. Profiles#

bash
# every 30 minutes: databases only, on the server, last 48 runs
cipi backup profile add hourly-db --scope=db --databases='shop,tenant_*' \
    --exclude-tables='*.jobs,*.telescope_*' --every=30m --keep=48 --dest=local
# every night: files + databases, encrypted, two buckets, 14 days
cipi backup profile add nightly --scope=all --cron='0 2 * * *' --keep-days=14 \
    --dest=s3,offsite --encrypt
FlagMeaning
--scope=all|files|dbWhat to take
--apps, --databases, --exclude-databasesGlob patterns; tenant databases created at runtime are found too
--exclude-tablesSkip noisy tables (*.jobs, *.telescope_*)
--every=30m|6h|1d or --cron='…'Schedule
--dest=local,s3,<name>Where to send it
--keep=N, --keep-days=N, --keep-weeks=NRetention
--encryptAES-256 before upload
bash
cipi backup profile list | show nightly | edit nightly --keep-days=30
cipi backup profile disable hourly-db | enable hourly-db
cipi backup profile remove hourly-db [--purge]   # --purge also deletes its runs

Apps can declare their own profiles in cipi.yml (named <app> or <app>-*); server-wide profiles stay yours.

3. Encryption#

The bucket provider never sees readable data. The manifest stays readable so runs can be listed.

bash
cipi backup key show       # store it off-server, now
cipi backup key rotate     # new key for future runs

Without the key, an encrypted backup cannot be restored by anyone. Runs taken before a rotation still need the old key.

4. Run, verify, restore#

bash
cipi backup run [--profile=nightly] [--dry-run] [--detach]
cipi backup list [--profile=nightly]
cipi backup verify [--deep]               # does the newest run open?
cipi backup fetch nightly 2026-11-02_020000 --dest=/root/restore
cipi db restore myapp /root/restore/databases/mariadb/myapp.sql.gz
tar -xzf /root/restore/apps/myapp/files.tar.gz -C /tmp/restore-files
Honesty checkEffect
Archive integrity tested before uploadA dump cut short by a full disk never replaces a good backup
Staleness watchdog (hourly)backup_stale when a profile hasn't succeeded in twice its interval
Empty fetch / nothing to verifyReported as an error, never as success
Prune errorsLogged and alerted, never swallowed

Layout#

<destination>/cipi/<profile>/<YYYY-MM-DD_HHMMSS>/
├── manifest.json
├── apps/myapp/files.tar.gz        # + meta.json
└── databases/mariadb/myapp.sql.gz

Files and databases are stored separately, so a database restores without unpacking an app. Staging uses /var/tmp (disk), not a small RAM-backed /tmp. Meilisearch indexes are not backed up: scout:import rebuilds them from the database.

Common problems#

ProblemFix
destination test failsWrong endpoint, region or key permissions on the bucket
Profile overduecipi backup status names it; check disk space and the run log
Can't open an encrypted archiveYou need the backup key from cipi backup key show (store it off-server)

Questions#

QuestionAnswer
Where should backups go?Off-site: another provider or region, S3-compatible. Your own: Johnny.
How often?Databases every 30–60 minutes for busy apps, everything nightly. Backup guide.
Have I tested a restore?Do it now with cipi backup fetch into a scratch folder: a backup you haven't restored is a hope.