Skip to Content

Keep data with volumes and backups

Give an app a persistent volume, back it up on a schedule and restore it.

Goal: an app whose data survives restarts and redeploys, with nightly backups you can restore.

Before you start

  • An app on a running cluster.
  • For backups: object storage in your organization. Backups are stored there and billed as storage usage. See Use object storage.

Add a volume

A container's own disk is wiped on every restart. Write data you want to keep to a volume.

Open the app on the project canvas and go to its Settings tab.

In the Storage section, select Add volume.

Pick New volume, or Mount existing to reuse a volume.

Enter a Volume name, a Mount path such as /data, and a Size in GiB.

Save and deploy the app.

Templates such as PostgreSQL bring their own storage; you set its size when you create them.

Add a backup policy

Apps with volumes and stateful templates get a Backups tab.

Open the Backups tab and select Add backup.

Pick the Source, or start from one of the presets.

Set the Schedule, for example every night.

Pick the Backup type:

  • Full: a complete copy every run.
  • Incremental: only the changes, with a full copy every 7th run.

Pick the Compression and the Destinations. The Primary target is used for restores by default.

Name the policy, such as nightly-data, and select Create policy.

Select Run now on a policy to take a backup at once.

Crash-consistent backups

Volume backups are taken while the app keeps running, so a restore looks like the moment after a power cut. Most apps recover from that. Run a database as a database app instead of on a volume: PostgreSQL backups can be restored to a point in time.

Verify

The backup history on the Backups tab lists every run. A run is running, then succeeded or failed. Filter it by policy or target.

Restore

In the history, select Restore on a backup. The Restore backup dialog opens.

Pick the target under Restore from target. For PostgreSQL, you can also Restore to a point in time between backups.

Read what the restore does, confirm I understand and start it.

What happens depends on the app:

AppRestore
PostgreSQLRestores into a new copy. The current database keeps running until you promote the restored copy.
ClickHouseRestores in place.
VolumesStops the app, replaces the data, then starts the app again.

Troubleshooting

  • No Backups tab: the app has no volume and is not a stateful template. Add a volume first.
  • A run failed: open it in the history for the error. Check that the target bucket still exists and is not over its quota.
  • The app lost its files after a restart: it writes outside the volume's Mount path. Change the app or the mount path.

Deleted apps

Deleting an app keeps its backups until their retention runs out. Select Restore into new app on a kept backup to bring the data back.

In IaC

An app file lists volumes (name, mount_path, size) and backup_policies (by default every night at 02:00, kept 7 days). See Volumes in IaC and backups in IaC.

Next steps

On this page