# Backups on Aria: schedule, restore and your own key

> How Aria backs up your databases and volumes, how to back up now and restore, and how to set your own schedule, retention and encryption key.

Source: https://getaria.cloud/docs/backups (updated 1 November 2026)

Aria backs up your databases and your volumes every night, encrypts the backups and stores them off your server. You can back up a database on demand from the Database page, restore one by typing its name, and choose the schedule, how long backups are kept and who holds the encryption key with a `backup` block in `aria.yaml`.

## What is backed up?

- Every Postgres database in your app.
- Every volume that your services declare.
- A Supabase database with its Storage files, as part of the app.

The nightly backups are encrypted and kept off the server. Without a `backup` block, Aria keeps them for 30 days. The Database page shows when the nightly backup runs and how long backups are kept. Redis is a cache, so it is not part of a restore.

## How do I back up a database now?

Open your project, go to **Database**, and choose **Back up now** on the database. The list shows each backup with its size when it finishes.

## How do I restore a database?

On the **Database** page, choose **Restore** next to the backup you want. Restoring replaces the database's current contents, so it is a destructive action: you type the database's name to confirm. For a Supabase, rebuild from **Settings**, then **Recovery**.

To start a whole new app from a backup, use the **Start from a backup** option, which restores the volumes and databases before any service starts and deploys the commit the backup was made from. This applies to backups made as sets, described next.

## How do I choose my own schedule?

Add a `backup` block to `aria.yaml`. Each run makes a set: every Postgres database, the volumes you list and the app's variables, encrypted and stored together.

```yaml
version: 1
services:
  web:
    type: web
    port: 3000
    volumes:
      uploads: /data/uploads
databases:
  main:
    type: postgres
backup:
  schedule: "0 3 * * *"
  retention:
    daily: 14
    weekly: 8
    monthly: 6
  volumes: [uploads]
  exclude: ["**/cache/**"]
```

| Field | Default | What it does |
|---|---|---|
| `schedule` | once a night | A five-field cron in UTC, at most once an hour. `"0 3 * * *"` is 03:00 every day. |
| `retention` | 14 daily, 8 weekly, 6 monthly (the defaults once you add a `backup` block) | Keeps the newest set of each of the last N days (1 to 90), weeks (0 to 52) and months (0 to 36). The newest set is always kept. |
| `volumes` | every volume | Which volumes to include. Write `service/name` if two services have a volume with the same name. |
| `exclude` | none | Paths inside the volumes to leave out. `**` matches any folders, `*` matches within a name. |
| `hooks` | none | Commands to run in a service before and after the copy. |
| `encryption` | Aria's key for your workspace | Encrypt to a key only you hold. |

A `backup` block needs something to back up: a Postgres database or a volume. A backup block replaces the nightly schedule for that app, and its `retention` replaces the 30 days; older backups stay restorable. The other limits are on [Limits](https://getaria.cloud/docs/limits).

## What if my app writes files that a copy could catch half-written?

Use hooks. A `pre` command runs before anything is copied and a `post` command runs after, in the service's running container.

```yaml
version: 1
services:
  notes:
    type: web
    port: 3000
    volumes:
      data: /data
backup:
  hooks:
    - service: notes
      pre: [/app/bin/backup-prepare]
      post: [/app/bin/backup-finish]
      timeout: 120
```

`timeout` is in seconds, from 1 to 600, and defaults to 120. If a `pre` command fails or times out, the whole backup fails and nothing is stored. `post` commands always run.

## Can I hold the encryption key myself?

Yes. Make an age key pair, keep the private key safe, and enter the public key (it starts with `age1`) in Aria as a secret. Name that secret in the file:

```yaml
backup:
  encryption:
    recipient_secret: BACKUP_AGE_RECIPIENT
```

Backups are then encrypted to your key only. Aria never has the private key, so it cannot read them, and a restore asks you for your key file. Keep the key safe: without it, the backups cannot be opened.

## Can I download a copy of a database?

Yes. On the **Database** page choose **Copy database**. Aria makes a fresh copy on the server and gives you a zip with the dump, plain SQL and a README, behind a link that lasts an hour. See [Your data](https://getaria.cloud/docs/data).

## How do I get back something I just deleted?

Users, rows and files you delete on the Database page wait 30 days in the **Archive**, so you can restore them without touching a backup. See [Your data](https://getaria.cloud/docs/data).

Next: [Team and roles on Aria Cloud](https://getaria.cloud/docs/team)
