Backup and Restore
AI Admin Panel backs up service databases and owned application volumes to S3. Platform administrators can also create a Full snapshot and restore an eligible managed service with a mandatory safety snapshot. Availability is checked for each backup; the panel explains why an unsupported backup cannot be restored. The first supported combined strategy is a managed Directus service with PostgreSQL 16 and owned application files, unassigned or assigned to a customer. Full snapshots of template apps whose database is PostgreSQL, MySQL or MariaDB, such as Ghost, Outline or Paperless-ngx, are restorable too (strategy app-db-logical-v1), and so are volume backups of apps without a database engine, such as n8n or OpenClaw (strategy files-cold-v1). All three are described under Restoring from Backup. Arrange and test recovery for your actual application before relying on a backup.
Retention now runs every hour for every enabled schedule. Before this release a schedule's retention period could also delete the service's backups of the other type, and cleanup rarely ran at all. The first hourly run after the upgrade deletes every backup older than its own schedule's period, which can be many backups that were never cleaned up. To keep them, raise the period or disable the schedule before upgrading; see Retention Policy.
The Backups page
Everything about backups has its own page: Backups in the sidebar, right after Health. It used to be one long list under Settings → Connectivity → S3 Storage. Backups are something you watch, not a setting you set once, so they moved. Old links and bookmarks to /settings/s3 open Backups → Storage.
| Tab | What it is for |
|---|---|
Overview (/backups) | What needs you (customer backups paused, S3 storage missing or broken, a cloud drive that needs reconnecting, storage that failed its test, backups kept on this server only) and every place backups can go right now. |
Storage (/backups/storage) | Each kind of storage with a short intro: what it is, who pays for the space, what the panel sees. Below that: the S3 storage for app backups, platform backup storage and cloud drives. |
Restore (/backups/restore) | Pick an app, then use its own Backups tab: its backups, Back up now, schedules and restore with a safety snapshot. ?app=<id> links straight to one app. |
Customers (/backups/customers) | What each customer plan lets its customers do with backups, in every edition, and the storage your customers connected themselves: whose it is, the kind and where, never their keys. |
Emergency & cleanup (/backups/emergency) | Pause customer backups and deleted customers' backups. |
Backups shows in the sidebar for anyone who may open Settings. Each section shows for the same people as before: platform storage, cloud drives, pausing and deleted customers' backups only for a platform operator (anyone else gets 404 from their routes, and the section stays hidden). The customer portal's Backups tab is unchanged.
A reseller's staff see only Overview and Restore. Storage, Customers and Emergency & cleanup manage the platform's own storage, customer plans and the pause switch, which only the platform operator can change. Their Overview leaves out the storage warnings and "Where your backups can go", and asks the server nothing about platform storage. Restore lists the apps of their own customers. A typed /backups/storage, /backups/customers or /backups/emergency opens the Overview.
A list of backup runs and schedules across all apps is planned for a later release. Until then each app's runs and schedules are on its own Backups tab.
Kinds of backup storage
The Storage tab shows each kind with its name and one line. The ? next to it opens who pays for the space and what the panel sees. All of it in one table:
| Kind | What it is | Who pays for the space | What the panel sees |
|---|---|---|---|
| This server's disk | Backups on this server's own disk. Nothing to set up. | You. It uses this server's disk; customer backups count toward their plan's backup space. | Everything, because the backups are on this server. |
| S3-compatible storage | A bucket at any S3 service, for example AWS, Wasabi, Backblaze B2 or MinIO. | Whoever owns the bucket, at that provider's price. | The address and the bucket name. The secret key is stored encrypted and never shown again. |
| SFTP server | Any server you reach with SSH, for example a NAS, a storage box or your own Linux server. | Whoever runs that server. | Host, user and folder. The login key is stored encrypted, and the server's fingerprint is checked on every connection. |
| Google Cloud Storage | A bucket in a Google Cloud project. | The owner of the Google Cloud project. | The project and the bucket. The service account key is stored encrypted. |
| Dropbox | A Dropbox account. | The owner of the Dropbox account, from their plan's space. | The account name. You allow access on Dropbox itself; no password reaches the panel. |
| Google Drive | A personal Google Drive or a Google Workspace drive. | The owner of the Google account, from their storage. | The account name. You allow access on Google itself; no password reaches the panel. |
| OneDrive | A personal OneDrive or OneDrive for Business. | The owner of the Microsoft account, from their storage. | The account name. You allow access on Microsoft itself; no password reaches the panel. |
This server's disk is the fastest to restore from, but it is lost together with the server. Add a copy outside this server too: a bucket or a server that you or someone else runs survives if this server is lost.
Cloud drives are connected through id.aiadminpanel.com: you allow access on the provider's own page with a short code, so no provider password is stored on this panel. The panel's own drives are connected under Backups → Storage → Cloud drives; customers whose plan allows it can then connect their own accounts in the portal (see Connect OneDrive, Dropbox or Google Drive).
Who can see backup history
Platform administrators can see every backup of a service. A reseller's service-backup list shows only captures recorded for the current customer in the service's current ownership generation. Moving a service to another customer hides its earlier backup history from tenant callers. Moving it back does not make that earlier history visible again. Older captures without recorded ownership remain platform-only.
This filtering does not delete stored backups. Platform administrators retain access to the historical rows. Creating, deleting and restoring backups remain platform-only; this change does not enable customer self-service or grant restore eligibility.
Letting customers use backups
Customers get the portal's Backups tab, and its buttons, only when their customer plan allows it. You set that in Backups → Customers → What customers may do with backups, in every edition. Each customer plan is listed with what its customers may do; Edit opens:
- Customers on this plan may: view, create, manage the policy of (schedule and delete), download and restore backups.
- Use own backup destination and the allowed kinds. Free keeps backups on this server, so there the switch is off and says that own storage needs Power User or Web Host.
- The limits: backup storage (MB), maximum retained backups, manual backups per day and the minimum interval. An empty field uses the default shown.
Only backup settings are saved here. A plan's limits, apps and prices stay in Business → Customer Plans, which needs Web Host; this card is what lets a Free or Power User panel offer portal backups at all (AI-1798).
API: GET /api/v1/backups/customer-plans lists the customer plans with only their backup settings. PUT /api/v1/backups/customer-plans/{id} with {"settings": {...}} replaces a plan's backup settings as a set: a key left out goes back to its default, and any key that is not a backup setting is refused with 400. Both need settings.plans_manage and a platform operator. A save is audited as plan.backup_settings_set. The admin MCP tools are get_customer_plan_backups and set_customer_plan_backups.
Read-only customer backup capabilities
GET /api/v1/portal/services/{id}/backups/capabilities reports the authenticated customer’s current service plan, safe policy values and preparation status. It does not create a backup, destination, repository or key. Unknown physical usage is null; catalog readiness alone does not prove that a producer, persistent repository, complete inventory or operation admission is available.
run (back up now), restore, download, policy (change the schedule) and delete (delete a backup; it needs backups.policy and the plan's backupPolicy) can become available: true. Each needs every check to pass:
- The login holds the action.
- The plan allows the action.
- The catalog is ready.
- The installation's LOCAL backup engine is ready. This sets
readiness.producerandreadiness.admissiontoready. - The service's policy is bound to a ready LOCAL repository of this customer. This sets
readiness.persistentRepositorytoready.
readiness.physicalInventory is ready when the storage a backup would use has known usage: the customer's own storage always does, and the operator's LOCAL storage does once every LOCAL repository of the customer has a current measurement. Under a finite backupStorageMB (anything but -1) the panel refuses a backup while usage is unknown, so run is then unavailable with physical_inventory_unavailable, and the portal says the provider must check the backup storage. To fix it, provision the customer again, which measures it. own_destination (connecting own storage) does not depend on the catalog or the LOCAL engine: it is available when the login holds backups.own_destination, the plan allows own storage, the edition allows it (otherwise edition_local_only on Free, or edition_unknown) and at least one kind in plan.allowedDestinations is one this panel can connect (otherwise destination_kind_unavailable). plan.allowedDestinations lists the kinds of own storage the customer may connect (see below). Each action's reasons lists exactly what is missing.
paused is the operator's backup kill switch: {"active": true, "reason": "...", "since": "..."} while customer backups are paused, with operator_paused in the reasons of run and own_destination.
Reading metadata requires backups.view, a current owned-service scope and an active, unexpired subscription. A plan with backupView: false returns locked metadata and withholds policy values. Missing or invalid plan/subscription data fails closed. Zero limits remain zero. Policy fields report requested and effective values, their source, and any plan or license restriction without exposing storage or key identifiers. policy.retentionDaysMax is the license age window a schedule may use (0 when the edition has none, null when the license cannot be checked), and policy.overrides holds the customer's own saved values for this service (service) and for all their services (customer); null means that scope does not set the value.
The Roles page labels backup permissions in all supported languages. backups.admin is an administrator marker; a future action also needs its exact permission and the customer’s plan. Marker and action grants may come from current organization-wide roles on the same customer; project and ancestor roles cannot provide that qualification. Default Customer roles receive the marker and action grants. Reseller, User and project defaults receive only backups.view; project reads are confined to services in their actual assigned project. Custom role grants are preserved during the permission-seed migration. This metadata preparation does not enable customer backup actions.
When these permissions are introduced, active organization-bound API keys retain any explicit denies and receive denies for new backup permissions that their creator does not hold through current organization-wide membership. Project-only grants do not count. Unbound and revoked keys are unchanged. Reseller receives view only, preserving delegated User and project-role assignment without granting backup administration or execution.
The migration's SQL rollback retains key security denies, including later explicit denies. The current binary supports SQL down/up with those retained names. An older binary may reject them, so reverting only the binary is not a recovery procedure: restore a consistent pre-upgrade database and binary instead.
The tenant MCP get_backup_capabilities tool uses the same metadata reader and requires the token’s backups.view access. Its existing organization-bound machine identity has no current human role qualification: actor.qualification is unavailable, administrator is false, and action authorization is false. It never borrows the token creator’s old or current administrator role.
Customer LOCAL backups: list, back up now, restore, download, delete
Once a platform operator has provisioned a customer's encrypted LOCAL repository (POST /api/v1/backups/local/customers/{id}/provision), the customer can manage LOCAL backups in the customer portal or through the API. Automatic backups stay Off (Built-in default) until someone turns them on: Back up now works straight away, and nothing runs on a schedule.
In the customer portal. A service page has a Backups tab when the plan has backupView and the login holds backups.view. The server enforces the same rule: without backupView it refuses the backup reads with 403 plan_view_denied (see below), and only the capabilities read answers, with locked metadata. The tab:
- Lists the backups (newest first) and the recent requests with their state. A volume backup is tagged Volumes. A failed backup of an app with a database engine says so (see Volume backups below).
- Offers Back up now, and a Restore, a Download and a Delete button on each backup.
- Shows a Downloads card with prepared downloads, their state and when they expire.
- Shows a Schedule card: whether automatic backups are on, how many backups are kept, the interval in minutes and the maximum age in days, each with where the value comes from (This service, Your default for all the customer's services, Provider, or Built-in default). A value the plan or license lowers says so.
Restoring asks the customer to type the service name. The warning says that changes made since the chosen backup are replaced, and that a safety backup of the current state is taken first.
Volume backups. The managed Directus template is backed up as a full snapshot (database and files). Any other app, such as n8n or OpenClaw, is backed up as a volume backup of its data volumes, and the customer restores it with the same Restore button, typed-name confirmation and safety backup. The restore stops the app, saves the current volumes as a new volume backup, replaces every volume with the chosen backup, checks every file, and starts the app again. It uses the same verified files-cold-v1 restore as a platform administrator's volume restore (see Volume backups). Two cases are explained in the tab:
- This backup cannot be restored (
restoreBlocked: capture_not_restorable): the backup was kept, but it could not include everything a safe restore needs, for example a volume over the restore size or file-count limit, or a link that leaves its volume. Restore is disabled with that reason; Download and Delete still work. - The app keeps its data in a database (
reason: database_engineon a failed backup): a volume backup cannot copy a running database engine such as MySQL or PostgreSQL consistently, so no backup is written. Ask the provider to protect that app.
A customer can only create LOCAL backups. Backups in the provider's S3 storage are made by a platform administrator, are not listed in the portal, and are restored by a platform administrator.
The buttons follow actions.run, actions.restore, actions.download and actions.delete from the capabilities response. When they are unavailable, the tab gives one reason in plain words: backups are not set up yet, the account lacks the permission, or the plan excludes the action. While a request is queued or running, or a download is being prepared, the list refreshes every five seconds.
Downloading a backup. Download does not send the file at once. The panel first prepares an archive in the background, through the same queue as backups and restores, and nothing on the service changes. When it is ready, the Downloads card offers the .tar file for 24 hours; after that the file is deleted from the server and the entry shows Expired. A customer can hold at most two prepared downloads at a time.
The archive holds the backup exactly as it was stored:
| File | Contents |
|---|---|
README.txt | What the files are and how to restore them without the panel |
descriptor.json | What the backup contains and the SHA-256 of every file |
recovery.json | How the panel restores it (databases, order, versions) |
manifest.json | Sizes and SHA-256 digests of the parts |
parts/NN-<name>.tar.gz | In a volume backup, one volume's files: extract into an empty directory with tar -xzpf <file> -C <directory> |
parts/NN-<name> | The data. A .pgdump file is a pg_dump custom-format dump: restore it with pg_restore --clean --if-exists --no-owner -d <database> <file>. The roles file is gzipped SQL of the database roles, without passwords |
While preparing the archive, the panel checks every part against the size and SHA-256 recorded at backup time and refuses to publish an archive that differs. The download is resumable (HTTP range requests), is never cached by the browser (Cache-Control: private, no-store), and its ETag is the archive's SHA-256. Each download is counted for egress and audited (backup.local_export_requested, backup.local_export_downloaded). Every local backup audit entry, including provisioning, captures and restores, names the signed-in user who acted, with their IP address and browser.
Operator note. Prepared archives live on the panel's backup volume under /var/lib/panel/backup-storage/exports (directory mode 0700, files 0600). An archive is about the size of the backup, so plan disk space for up to two per customer. Expired archives and leftovers of an interrupted preparation are removed automatically by the backup reconcile pass. If the directory cannot be opened safely at start-up, the panel logs a warning and downloads answer 409 local_backups_unavailable; backups and restores keep working.
Changing the schedule. When actions.policy is available, the Schedule card offers Edit schedule. The customer administrator picks This service or All my services (default) and sets each value, or ticks Inherit so the next scope's value applies again. The form shows the limits as hints: backups kept from 1 to the plan's keepLastMax, an interval of at least the plan's minIntervalMinutes, and a maximum age from 0 to the license age window (30 days for Power User, 90 for Web Host; Free has none, so only 0). The server refuses a value outside these limits with 422 backup_policy_out_of_bounds; it never stores a smaller or larger value instead. Saving needs a signed-in customer administrator holding backups.view, backups.admin and backups.policy, and a plan with backupPolicy. Each save is audited as backup.policy_updated with the signed-in user, the scope and the values. The scheduler uses the saved values from its next pass.
Deleting a backup. Delete asks for confirmation, then queues the permanent removal of that one backup from the customer's encrypted repository, through the same queue as backups and restores. Nothing on the service changes. The panel forgets the backup's restic snapshot, prunes the repository so the space is freed, and measures the repository's usage again. Two backups can never be deleted, and their Delete button is disabled with the reason on hover:
- the newest backup, of any kind, so the service always keeps one point to restore;
- a backup a queued restore or download still needs, until that request has finished.
Deleting needs the same authority as changing the schedule: a signed-in customer administrator holding backups.view, backups.admin and backups.policy, and a plan with backupPolicy (actions.delete). Each request is audited as backup.point_delete_requested with the signed-in user and the backup's id. If a delete is interrupted after the snapshot was forgotten, the backup stays in the list tagged Delete incomplete; it can no longer be restored or downloaded, and pressing Delete again finishes the job. Deleting a backup that a later safety backup was taken from leaves that safety backup intact.
Scheduled backups. When a service's effective backup policy is enabled, the panel also backs it up on a schedule, with no one signed in. A customer administrator chooses this in the Schedule card; that needs the plan's backupPolicy and the login's backups.policy. A scheduled volume backup stops the app while it runs, so turn it on when that is acceptable. The interval comes from the policy (service setting, then customer default, then platform default, then daily) and is never shorter than the plan's minimum interval. Scheduled backups appear in the list as Scheduled. They:
- do not count against the plan's manual backups per day;
- wait their turn like manual ones: one request per service, one backup at a time on the host, and customers served in turn;
- respect the storage limit: at the limit, or while usage is not yet measured, the scheduled backup is skipped and tried again one interval later.
Each scheduled backup is checked twice, when it is queued and again just before the backup engine runs: the policy must still be enabled, the plan must still allow backups, the customer and subscription must still be active and the service must still belong to the same customer and ownership. If any of that changed, the request is cancelled and nothing runs.
Old scheduled backups are removed automatically. After each scheduled backup completes, the panel applies the effective policy's retention to that service's Scheduled backups only:
- it keeps the newest keep last scheduled backups (the newest one by default);
- with an age window above zero, it also removes scheduled backups older than that many days;
- it never removes the newest completed backup of the service, of any kind;
- it never removes Manual or Safety backups; those stay until someone deletes them;
- it skips a backup that a restore or download still refers to.
The removed backups are forgotten from the restic repository and the repository is pruned before its usage is measured, so the storage figure reflects the freed space. A backup being removed leaves the customer portal's list at once and can no longer be restored or downloaded; the operator's Backups tab may briefly show it as Delete failed. If removal is interrupted, it stays marked that way and the next scheduled backup removes it; the backup that just completed is never affected.
Through the API. Eight portal routes serve an owned service:
| Route | What it does | Who may call it |
|---|---|---|
GET /api/v1/portal/services/{id}/backups/local | Lists restorable LOCAL points (newest first, at most 100), each with status (completed, or delete_failed after an interrupted delete), deleteBlocked (newest, in_use or null), backupType (full or volume), restoreBlocked (capture_not_restorable or null) and where it is stored (storage: local, s3 or sftp, with destinationId and destinationLabel for the customer's own storage), the 20 most recent backup, restore or delete requests with their state and reason (database_engine or null), and the 20 most recent downloads (exports) | backups.view, active subscription, a plan with backupView; API keys may read |
POST /api/v1/portal/services/{id}/backups/local/capture | Queues one manual backup into the customer's own repository; answers 202 with an operationId. An optional body {"destination": "local"} or {"destination": "<own storage id>"} picks where this one backup goes; without a body it goes where the schedule stores backups | A signed-in customer administrator: backups.view, backups.admin and backups.run, and a plan with backupRun |
POST /api/v1/portal/services/{id}/backups/local/points/{backupId}/restore | Queues a guarded restore of a listed full or volume point onto the same service. A verified safety backup is taken before anything changes. A point with restoreBlocked answers 409 restore_not_available | A signed-in customer administrator: backups.view, backups.admin and backups.restore, and a plan with backupRestore. API keys and MCP tokens are refused (403) |
POST /api/v1/portal/services/{id}/backups/local/points/{backupId}/export | Queues preparation of a download of a listed point; answers 202 with an operationId | A signed-in customer administrator: backups.view, backups.admin and backups.download, and a plan with backupDownload |
POST /api/v1/portal/services/{id}/backups/local/points/{backupId}/delete | Queues the permanent removal of a listed point; answers 202 with an operationId | A signed-in customer administrator: backups.view, backups.admin and backups.policy, and a plan with backupPolicy |
GET /api/v1/portal/services/{id}/backups/local/exports/{operationId}/download | Sends a ready, unexpired archive as application/x-tar | The same as preparing it, plus a plan with backupView, checked again at the moment of download |
PUT /api/v1/portal/services/{id}/backups/local/policy | Replaces this service's schedule: {"enabled", "keepLast", "intervalMinutes", "retentionDays"}, each a value or null to inherit, and optionally "destination" ("local" or an own storage id; left out, the storage stays as it is). Answers 200 with the new effective schedule (the capabilities policy shape) | A signed-in customer administrator: backups.view, backups.admin and backups.policy, and a plan with backupPolicy |
PUT /api/v1/portal/services/{id}/backups/local/policy/customer | The same body, saved as the customer's default for all their services; answers with the effective schedule of the service in the path | The same as the service schedule |
A schedule body is one JSON object with only those four fields (plus the optional destination); an unknown field (for example a misspelt keep_last, or a customer id) is refused with 400 validation_failed rather than ignored, because an ignored field would silently clear that value. The customer and service always come from the signed-in customer and the path.
All POST routes need an Idempotency-Key header holding a UUID the client generates. Sending the same key again returns the original operation instead of queuing a second one; after a 503 the client retries with the same key.
The routes only show and act on the service's current ownership. Points captured before the service moved to another customer are never listed or restorable, even if it later moves back. When it moves back, the customer's Backups tab opens again with only the points taken since; a service schedule saved before the move stays on record but is not applied again, so the service follows the customer's default schedule until someone saves a new one. The server derives the repository from the service's backup policy; a caller cannot name one.
Capture, restore, downloads, deletes and schedule changes need a person: an API key, an MCP token or a platform operator session is refused with 403. The panel re-checks the person's session, role and membership when the request is queued and again before the backup engine runs. Only the schedule above backs up without a person, and only while the service's policy is enabled.
| Answer | Meaning |
|---|---|
403 forbidden | Not a signed-in customer administrator, the plan does not allow it, or the point is not restorable for this service |
403 plan_view_denied | The plan has no backupView: the backup list, downloads, the own-storage list and reading, starting or checking a cloud connection are refused (a disconnect still works and its answer names no account), even though the service is yours (the Backups tab is hidden for the same reason) |
404 not_found | Not your service (another customer's service looks the same as one that does not exist), or, for a delete, not one of this service's current backups |
409 backup_point_newest_protected | A delete of the service's newest backup; take a newer backup first |
409 backup_point_held | A delete of a backup that a queued restore or download still needs |
409 local_backups_unavailable | LOCAL backups are not set up for this customer or installation yet |
404 not_found (download) | The download does not exist, has expired, or belongs to an earlier owner of the service |
422 backup_policy_out_of_bounds | A schedule value is outside the plan or license limits; the message names the field and the allowed range |
409 backup_operation_running | A backup or restore is already queued for this service, or the key was used for a different request |
429 rate_limited | Two downloads are already prepared or being prepared, or the plan's limit is reached: manual backups per day, minimum interval, or storage full. Storage that crosses the limit during a backup is kept; the next backup is refused |
The tenant MCP tool list_local_backups returns the same list, without half-deleted points, and is refused with plan_view_denied under the same rule. There is no MCP tool for capture, restore, downloads or deletes. The capabilities response tells a client whether Back up now and Restore will be accepted: see actions.run.available and actions.restore.available above.
Customer-owned backup storage
A customer administrator can connect backup storage of their own (AI-1645, the Plesk principle). The kinds offered are the intersection of the customer plan, the reseller's plan when the customer sits anywhere below a reseller, and the edition (Free is LOCAL only); see Service Plans.
GET /api/v1/portal/services/{id}/backups/destinationslists the customer's own storage that this service may use (customer-wide entries and entries connected for this service), with non-secret settings only, andimplementedKinds, the kinds this panel version can connect. It needsbackups.viewand a plan withbackupView(otherwise403 plan_view_denied); the same read is the tenant MCP toollist_backup_destinations.POST .../backups/destinationstests the connection first and saves nothing when the test fails (422 backup_destination_probe_failed, naming the cause, for exampleaccess_denied). A kind the plan, reseller or edition does not allow is refused with403 backup_destination_not_allowedbefore any connection is made.scope: "customer"lets every service of the customer use the storage;"service"only the service in the path. Access keys are write-only and never returned. A name is unique per customer (409 backup_destination_label_taken); a customer can hold 20 destinations.DELETE .../backups/destinations/{destinationId}removes one. Storage that is chosen in a schedule or still holds backups is refused with409 backup_destination_in_use. Removing is allowed even after the plan stopped allowing new storage.
Connecting and removing need a signed-in customer administrator holding backups.view, backups.admin and backups.own_destination; API keys and MCP can list but never connect or remove storage. Another customer's service or storage answers 404, checked in the database query and by a database trigger, never by the browser. Each connection and removal is written to the audit log without secrets.
S3-compatible storage
S3-compatible storage (kind: "s3") works with Amazon S3, Backblaze B2 (S3 API), Wasabi, MinIO and other S3 services. In the portal's Backups tab, the Own backup storage card has Add S3 storage. Settings:
| Setting | Notes |
|---|---|
endpoint | The provider's S3 host name, for example s3.eu-central-1.amazonaws.com. HTTPS only; a path, user name or query is refused. |
bucket | 3 to 63 lowercase letters, digits, dots or hyphens. |
prefix | Optional folder inside the bucket. Backups stay under it. |
region | Optional; needed by providers that check it. |
Credentials are accessKeyId and secretAccessKey. Use a key limited to this bucket. The key is written once to the customer's own OpenBao backup namespace (backup/destinations/<id>/credentials, create-only) inside the save, never to the database, the audit log or any API answer. Removing the storage destroys the saved key. A panel without OpenBao connects no kind.
The connection test runs before saving. It checks that the bucket exists, then writes, lists and removes one small file under <prefix>/aap-connection-test/. It touches nothing else. A failed test saves nothing, and its reason is one of:
| Reason | Meaning |
|---|---|
access_denied | The provider refused the key, the secret or the key's bucket rights. |
bucket_not_found | The bucket does not exist, or this key cannot see it. |
wrong_region | The provider expects another region or endpoint. |
list_denied | The key can write but not list; backups need list access. |
blocked_address | The endpoint resolves to a private, loopback, link-local (cloud metadata) or other internal address. The panel never connects there for a customer. |
tls_failed | The provider's HTTPS certificate was not accepted. |
unreachable | No answer, for example a wrong host name. |
Backups to this storage use restic's own S3 backend (the restic already in the panel image). Each repository gets its own folder, <prefix>/aap-repositories/<repository id>, so cleaning up (forget and prune) one repository never touches another one in the same bucket.
SFTP server
An SFTP server (kind: "sftp") is any SSH server the customer controls, such as a storage box or their own server. In the Own backup storage card, use Add SFTP server. Settings:
| Setting | Notes |
|---|---|
host | The server's host name or IP address. It must resolve to a public address. |
port | 1 to 65535; default 22. |
username | The SSH user. |
path | A folder that already exists, for example /backups/panel. Backups stay inside it. Without a leading / the folder is relative to the SSH user's home folder, for both the connection test and the backups (restic's sftp:user@host:path syntax keeps it relative). /, .. and other characters than letters, digits, ., -, _ and / are refused. |
hostKeyFingerprint | The server's SHA256: host-key fingerprint. Empty on the first attempt; see below. |
Only key login is supported. The single credential is privateKey: an OpenSSH private key without a passphrase that only this panel uses. Add its public key to the user's ~/.ssh/authorized_keys on the server. A password, or a key with a passphrase, is refused. The key is stored like the S3 key: once, in the customer's own OpenBao backup namespace, never in the database, the audit log or an API answer.
The server's identity is pinned. The panel never trusts a host key it has not been told to trust:
- The first test, without
hostKeyFingerprint, connects, reads the server's host key and stops before logging in. It answers422 backup_destination_probe_failedwith the messagehost_key_unconfirmed: SHA256:…. Nothing is written or saved. - The portal shows that fingerprint. Compare it with the server, for example
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pubon the server or your provider's documentation. Confirm only if they match. - The same request is sent again with that
hostKeyFingerprint. The test now logs in with the key, writes, lists and removes one small file namedaap-connection-test-<random>in the folder, and saves the storage with the exact host key it saw.
Changing the host or port in the form forgets the confirmation. A server that later shows another key is refused as host_key_mismatch.
| Reason | Meaning |
|---|---|
host_key_unconfirmed | First contact; the message carries the server's fingerprint to confirm. |
host_key_mismatch | The server's key differs from the confirmed fingerprint. Do not continue unless you know why it changed. |
access_denied | The server refused this key for this user. |
path_not_found | The folder does not exist, or it is a file. |
write_denied | The user may not write to the folder. |
list_denied | The user may write but not list the folder. |
delete_denied | The user may not delete files in the folder; removing old backups needs it. |
sftp_unavailable | The server accepted the key but offers no SFTP for this user. |
blocked_address | The host resolves to a private, loopback, link-local or other internal address. |
unreachable | No answer, for example a wrong host name or port. |
Backups to this storage use restic's own sftp backend, which runs OpenSSH with key login only, no agent, no password prompt and strict host-key checking against the one confirmed key. Each repository gets its own folder, <path>/aap-repositories/<repository id>, so forget and prune on one repository never touch another one.
Connect OneDrive, Dropbox or Google Drive
Dropbox (kind: "dropbox"), Google Drive ("gdrive") and OneDrive ("onedrive") are listed in the same Own backup storage card as every other kind (AI-1888). They have no credentials form: you allow the panel to use your account on id.aiadminpanel.com, and no provider password ever reaches the panel.
- A panel operator enables cloud connections once (see Enable cloud connections below). Until then the card says Cloud storage connections are not set up on this panel yet and offers no cloud kinds.
- In the portal's Backups tab, choose Add Dropbox, Add Google Drive or Add OneDrive, give the storage a name and choose who may use it.
- The panel shows a pairing code and a link to id.aiadminpanel.com. Open the link, type the code there, and allow access at the provider. The code is never part of the link.
- The dialog checks every few seconds; I allowed access checks at once. When access was allowed, the row says Connected as and the account name.
Each row says its state in plain words:
| State | Meaning | What you can do |
|---|---|---|
| Not connected | Saved, but access was not allowed yet, or the code expired. | Connect |
| Waiting for you to allow access | A code was issued and the panel is waiting. Only the sign-in that started it sees the code; any other sign-in reads Started in another sign-in. | Show code (same sign-in), Start again, Disconnect |
| Connected as account | Access was allowed and the provider confirmed the account. | Check connection, Disconnect |
| Needs reconnecting | The provider no longer accepts the panel's access. | Reconnect, Disconnect |
| Different account | A reconnect allowed a different account than the one that holds the backups. The row names the new account; backups stay paused. | Reconnect (with the original account), Disconnect |
| Disconnected | The panel forgot its access. | Connect |
| Connection service closed | id.aiadminpanel.com was not taking new connections when this one started. Existing connections keep working. | Connect once the service is open again |
When the connection service is not taking new connections, the card and every start answer say so plainly (503 backup_connection_onboarding_closed); nothing is lost and you can try again later.
Disconnect revokes the panel's access at the connection service and deletes the stored tokens. It does not remove the consent at the provider: also remove the access in your provider account. A connected cloud destination cannot be removed until it is disconnected (409 backup_destination_connected).
API (the browser session cookie only; the same permission rules as S3/SFTP):
POST .../backups/destinationswithkinddropbox,gdriveoronedriveand emptysettingsandcredentialssaves the destination unconnected.GET .../backups/destinations/{destinationId}/connectionreads the state.POST .../backups/destinations/{destinationId}/connectionwith{"locale": "en"}starts (or restarts) the connection and returns the pairing code and the id.aiadminpanel.com address.POST .../connection/checkasks whether access was allowed and finishes the connection; it answers409 backup_connection_not_yoursto any other sign-in.DELETE .../connectiondisconnects.
With a plan without backupView, reading, starting and checking a connection answer 403 plan_view_denied. Disconnecting still works, and its answer then carries only service and state, never the provider or the connected account.
Who may connect, checked on the server for every step from the database, never from the request:
- Customer administrator: a signed-in member of the customer's organization through a role with
backups.view,backups.adminandbackups.own_destination; the plan has Own backup storage with the kind allowed, every reseller above the customer allows it too, and the edition is not Free. An ordinary User only sees the list and states. - Platform operator: the panel's own connections in Backups → Storage. That is the administrator the installer created (an
adminlogin with no organization membership that has never belonged to a reseller or customer), or a member of the platform organization through a role withbackups.admin. The installer administrator is not a member of the platform organization (the panel creates it, named Platform, with no members) and may enable and connect without a membership. A deactivated login has no authority. - A start, check or finish belongs to the sign-in that started it. Signing out, a session expiry or another sign-in cannot continue it. Another customer's destination answers
404.
The tenant MCP tool list_backup_destinations includes each cloud destination's connection state (never the pairing code). Connecting is browser-only, because a person must allow access at the provider.
Enable cloud connections. A platform operator opens Backups → Storage, section Cloud drives, and chooses Enable cloud connections. The panel creates its installation keys in OpenBao and registers at id.aiadminpanel.com; OpenBao must be configured. The same section connects the panel's own Dropbox, Google Drive and OneDrive with the same pairing steps. Its API is GET /api/v1/backups/cloud-connections, POST .../enable, POST .../{provider}/connect, POST .../{provider}/check and DELETE .../{provider}, with provider dropbox, google or microsoft; anyone but a signed-in platform operator gets 404. When enabling fails, the answer stays a plain "could not be enabled right now"; the panel log names the step that refused (cloud backup enable refused, with step=authority, installation_keys for the keys in OpenBao, or relay_enroll for the registration at id.aiadminpanel.com) and never a key, token or session.
Where the backups go (AI-1645 D5). Once a cloud destination is connected, the panel asks the provider which account it is and which folder the panel may use, and stores backups only there:
| Provider | Folder the panel uses |
|---|---|
| Dropbox | The managed app's own folder, Apps/<app name>. The app has app-folder access only, so the rest of the Dropbox is not reachable. |
| Google Drive | A folder the panel creates, AI Admin Panel backups. With the drive.file access the panel sees only files it created. |
| OneDrive | The managed app's own folder, Apps/<app name>, on a personal, work or school OneDrive. A SharePoint library is refused. |
The first account and folder are pinned to the connection: a later reconnect to another account shows Different account and never writes to, or reads from, that account. Each repository gets its own folder inside, aap-repositories/<repository id>, with the same encryption, password and checks as every other storage. A connected cloud destination is offered in the schedule's Stored on field and for Back up now like S3 and SFTP storage, and restore and download read from it.
Checks. The panel asks every connected provider again every 6 hours, and Check connection asks at once. When the provider refuses the panel's access (for example, the access was removed in the provider account), the row turns to Needs reconnecting, the destination is marked failed so no backup is queued to it, and platform operators get one notification (category Backup events) for it; a provider that is only unreachable changes nothing. The same happens for Different account. Reconnecting the original account lets backups run again.
API: GET .../connection and the destination list include account (the account the provider reported, such as Ada Lovelace (ada@example.com)) and the state account_changed; POST .../connection/check on a connected destination asks the provider again and answers the new state. The tenant MCP tool list_backup_destinations reports the same account and state. The platform's own connections under Backups → Storage show the same account and Check connection. Each state that needs you says why on its row: waiting for the pairing code, needs reconnecting (the provider no longer accepts the panel's access; nothing stored is lost), disconnected, or connection service closed.
Choosing where backups go
Once own storage is connected and its test passed, a customer administrator chooses where backups are stored (AI-1886):
- The schedule. In the Backup schedule card, Edit schedule has a Stored on field: the provider's storage or any tested own storage the plan still allows. For one service, storage connected for all services or for that service is offered; for the customer default ("All my services"), only storage every service may use. The card shows where scheduled backups go.
- Back up now. Above the backup list, Where to store this backup picks the storage for one manual backup: the schedule's choice (default), the provider's storage, or a tested own storage.
- The list has a Stored on column naming the storage of each backup. Restore, download and delete work the same for every storage. Operators see the storage of each backup on the service's Backups tab in the admin area (
storage: {kind, destination_label}inGET /api/v1/services/{id}/backups).
The server checks every choice again, whatever the browser offered: the storage must belong to this customer (and to this service, when it was connected for one), its test must have passed, and the customer plan, the reseller's plan and the edition must still allow its kind. Otherwise the request is refused with backup_destination_not_allowed or 404, and nothing is queued. Storage that cannot be reached, or that refuses the panel's key, answers backup_destination_unreachable; test it again under Own backup storage.
How the backups run: the same encrypted restic repository, password and safety checks as LOCAL backups, with the repository on the customer's storage in aap-repositories/<repository id>. The panel never keeps a copy on its own disk, and backups on the customer's storage are not counted against the operator's storage limit. The panel image includes the OpenSSH client for SFTP. Restore and download read from the same storage, so a backup is restorable only while its storage is reachable.
Address pinning (AI-1882). A host name that passed the connection test could later point inside the server's network. The panel checks the address on every run, not only at the test: for S3, restic reaches the storage only through a short-lived proxy inside the panel that opens one connection, to the saved endpoint, after checking that every address of the name is public (HTTPS stays end to end, so the certificate is still checked for the name). For SFTP, the panel resolves and checks the host before each run and starts ssh with that checked address while still pinning the confirmed host key to the saved name. A name that now points to a private, loopback or link-local (cloud metadata) address stops the run before any data is sent.
Dropbox, Google Drive and OneDrive run the same way through the panel's bundled rclone (see Connect OneDrive, Dropbox or Google Drive). Google Cloud Storage (below) runs on restic's own gs backend (AI-1909). A kind that is not implemented yet is not in implementedKinds, and connecting it answers 422 backup_destination_kind_unavailable.
Google Cloud Storage
Google Cloud Storage (kind: "gcs", AI-1890) uses restic's own gs backend with a Google Cloud service-account key. In the Own backup storage card, use Add Google Cloud Storage. Settings:
| Setting | Notes |
|---|---|
bucket | 3 to 63 lowercase letters, digits, dots, hyphens or underscores. Names starting with goog are refused. |
prefix | Optional folder inside the bucket. Backups stay under it. |
The single credential is serviceAccountJson: the whole JSON key file of a service account. To make one in the Google Cloud console:
- IAM & Admin → Service accounts → Create service account. Give it no project-wide role.
- On the bucket, Permissions → Grant access: the service account with the role Storage Object Admin (
roles/storage.objectAdmin). The panel needs to create, list and delete objects in this one bucket, nothing else. - On the service account, Keys → Add key → JSON, and paste the file (or load it with Load key file).
The panel checks the file before anything else: it must be a service_account key with an RSA private key, and its token_uri must be Google's own (https://oauth2.googleapis.com/token). A file naming another sign-in address is refused, because the panel and restic would send a signed request there. The panel keeps only the fields it needs (project, account e-mail, key id, private key) with Google's address fixed, and stores that once in the customer's own OpenBao backup namespace, never in the database, the audit log or an API answer. The list shows the bucket, folder, project and the service account's e-mail, so the owner can see which account is used, never the key. Google lets you hold the same storage through an HMAC key and the S3 kind instead (storage.googleapis.com); the service-account key is the native way.
The connection test signs in to Google with the key, then writes, lists and removes one small object under <prefix>/aap-connection-test/. It touches nothing else. A failed test saves nothing:
| Reason | Meaning |
|---|---|
access_denied | Google refused the key (deleted, disabled, or a disabled account), or the account may not write to the bucket. |
bucket_not_found | The bucket does not exist, or this account cannot see it. |
list_denied | The account can write but not list; backups need list access. |
delete_denied | The account can write but not delete; removing old backups needs it. |
blocked_address | Google's address resolved to an internal address on this server (DNS tampering). |
tls_failed | The secure connection to Google failed. |
unreachable | No answer from Google. |
Once tested, the bucket can be chosen like S3 or SFTP storage: under Stored on in the backup schedule and in Back up now (AI-1909). Scheduled and manual backups, restore, download and delete all use restic's gs:<bucket>:/<prefix>/aap-repositories/<repository id>, one folder per repository. For each run the panel rebuilds the key from the customer's vault namespace, with Google's address fixed, and writes it to a private file (mode 0600) inside that run's private working folder (mode 0700). restic finds it through GOOGLE_APPLICATION_CREDENTIALS, which holds only the file's path; the key itself is never on the command line, in the environment or in a log, and the folder and file are removed when the run ends. A vault value that names another sign-in address is refused and the run does not start. restic then talks only to Google's fixed addresses (oauth2.googleapis.com and storage.googleapis.com); the customer cannot name another host for this kind, so there is no customer address to pin as for S3 and SFTP above.
A kind that is not implemented yet is not in implementedKinds, and connecting it answers 422 backup_destination_kind_unavailable.
Platform backup storage (operator destinations)
A platform administrator can connect backup storage for the platform itself (AI-1890): any kind this panel version implements (S3-compatible, SFTP, Google Cloud Storage), not only the single legacy S3 target under Storage Targets. Open Backups → Storage → Outside this server and choose the kind. The connect forms are the customer portal's: the connection is tested first and nothing is saved when the test fails, and the key is stored only in the platform's own OpenBao backup namespace and never shown again.
Each platform destination is either:
| Use | Who can choose it |
|---|---|
| Platform only | The operator alone. Customers never see it, and the database refuses a customer destination that points at it. |
| Offered to customers | The operator and every customer. Customers see it in the portal's Backups tab as Provided by your host: its name and kind only, never its settings or key, and they cannot remove it. |
Whether storage is offered is fixed when it is connected; connect it again to change it. Removing a platform destination deletes its key from the vault. Storage that still holds backups, is chosen in a schedule or is used by a customer's destination is refused with 409 backup_destination_in_use.
The Customers tab of the Backups page shows every customer's own storage: whose it is, its kind and its non-secret settings (bucket, host, folder). Keys stay in each customer's vault namespace and are never returned by any API, so the operator can see what every customer connected without being able to read their credentials. Customers' storage is theirs to remove.
The kill switch does not apply here: the operator can connect and remove platform storage while customer backups are paused. Choosing a platform destination for a schedule or a manual backup comes in a later release; until then the platform's backups keep using LOCAL storage and the legacy S3 target. Customers choose their own storage as described in Choosing where backups go.
API (platform administrators only; anyone else gets 404):
GET /api/v1/backups/destinationsreturnsplatform(withscopeplatformorofferedand settings),customers(withcustomerId,customerand settings) andimplementedKinds. The same read is the admin MCP toollist_platform_backup_destinations(the platform key needsbackups.view).POST /api/v1/backups/destinationstakes the portal's body withscopeplatform(the default) oroffered. Audited asbackup.platform_destination_connected.DELETE /api/v1/backups/destinations/{destinationId}. Audited asbackup.platform_destination_removed.
Connecting and removing are not MCP tools: a storage key must not pass through an assistant.
Pausing customer backups (kill switch)
A platform administrator can pause every customer's and reseller's backups at once (AI-1890). Use it for storage maintenance, an incident, or abuse. Open Backups → Emergency & cleanup, choose Pause customer backups and give a reason of 3 to 500 characters. Every customer and reseller sees that reason in the portal's Backups tab until you choose Resume customer backups. Never put a password or key in the reason.
While backups are paused:
| What | Paused behaviour |
|---|---|
| Back up now | Refused with 409 backups_paused |
| Scheduled customer backups | Not queued; the schedule resumes when you resume |
| Customer backups already queued | Cancelled when they reach the worker, before anything runs; their daily allowance is given back |
| Backups already running | Finish |
| Connecting own storage | Refused with 409 backups_paused, before any connection test |
| Connected storage and existing backups | Kept, not deleted |
| Restore, download, delete a backup | Still possible |
| The operator's own backups | Not affected |
When the switch is turned on, the server waits for any admission already in progress; once Pause returns, no new customer backup can still be queued.
The same switch is GET and PUT /api/v1/backups/kill-switch (platform administrators only, body {"active": true, "reason": "..."}) and the admin MCP tools get_backup_kill_switch and set_backup_kill_switch (the platform key needs backups.view and backups.admin; the admin chat asks before each change). Every change is audited as backup.kill_switch_on (with the reason) or backup.kill_switch_off. Rolling back the database migration is refused while the switch is on.
Backup Types
Encrypted repository rollout
The image includes a pinned encrypted repository engine and private repository identity/key storage. Operator storage-account credentials and each customer's repository password have separate ownership. Backup key namespaces are retained independently of ordinary customer vault deletion; a missing key fails closed instead of creating a replacement. Retained metadata alone does not preserve backup rows that are removed with a service, or implement the later offboarding export window.
Existing Backups actions continue to use their established legacy/v1 formats. This foundation does not enable customer cloud capture or restore, or change encryption on existing backup files. Those actions require the separately verified capture/recovery coordinator and provider integrations.
The bundled engine updates with the panel image. Its source build uses Go1.26.11 for the crypto/x509 and net/http security fixes, while its upstream version remains0.19.1 and existing repository formats stay unchanged. Build and CI checks reject an older compiler or mismatched artifact manifest before vulnerability scanning and native tests. These checks do not validate arbitrary operator-supplied executables or replace the full image security scan. There is no engine self-update command.
The panel image also rebuilds its pinned Railpack 0.42.0 CLI from checksummed source with Go 1.26.11 and retained symbols. Its matching BuildKit frontend version and deployment commands stay unchanged. Retained symbols let binary scanners distinguish linked packages from unused modules; a module-only warning does not prove an application call path. Artifact checks are consistency checks, and the complete rebuilt image still needs its vulnerability, secret and dependency inventory gates. This build preparation does not enable customer cloud restore.
The image also builds Docker CLI 29.8.2 and Buildx 0.38.1 from checksummed upstream source with Go 1.26.11, retained symbols and locked security patches. Their existing executable/plugin paths and deployment arguments stay unchanged. CI checks static identity and scans both binaries and their shipped command source graphs. Source metadata does not replace native BuildKit compatibility testing or the complete rebuilt image's security scan.
The image also contains rclone 1.75.2 at /usr/local/bin/rclone, built from its checksummed upstream source with Go 1.26.11 and only the Dropbox, Google Drive and OneDrive backends (no self-update, mount, config or remote-control commands). It is the transport for managed cloud destinations: restic reaches it through a private per-job socket, and a short-lived local token broker gives it access tokens while rotated refresh tokens stay in OpenBao. The installation never holds the providers' app secrets. Backups to connected Dropbox, Google Drive and OneDrive destinations run through it (AI-1645 D5). CI checks its build identity, scans it and runs real restic through it before an image can publish.
Managed cloud connection preparation
The internal managed-connection foundation stores installation keys and private authorization grants in OpenBao, with a separate database journal. It persists a received credential and its pending acknowledgement before contacting the relay to acknowledge it. Uncertain refreshes reconcile the same operation; disconnect writes a readable revoked marker before removing remote panel-grant authority. Keys are created only by explicit initialization and never replaced by a read.
Since AI-1888 the session/role adapter is in place and the connection commands are enabled behind it: see Connect OneDrive, Dropbox or Google Drive. Since AI-1645 D5 the provider storage adapters run backups and restores on connected customer destinations. File-backend managed credentials remain a separate rollout gate. A logical customer destination and its private repository remain separate from a shared operator storage connection. Disconnecting a panel grant does not remove provider-wide consent or erase historical vault versions.
Protect a consistent database, vault and installation-key backup. An old database or vault copy may lag the relay's connection generation and must fail closed; missing known keys never trigger automatic replacements. This foundation does not yet provide the customer recovery-kit workflow. Preserve existing recovery procedures until that workflow is verified with the actual provider account.
The separate managed authorization service defaults to closed onboarding. Its operator must explicitly enable new enrollments and connection starts after the public routing, WAF and provider checks; existing enrollments do not bypass this policy. Closing onboarding keeps authenticated recovery of already-delivered grants, refresh and disconnect available. A fresh recovery installation requires new enrollment and explicit reopening. The service health endpoint reports liveness, not certified cloud backup availability.
Customer policy preparation
The internal policy foundation selects each setting separately: a current service override, a retained customer default, a platform default, then a safe built-in default. Explicit false and zero survive inheritance. Service settings are tied to both the current ownership generation and the service lifetime, so reassignment or recreation cannot revive an earlier owner's service settings.
Selection and limits are separate. A plan limits retained copies and minimum backup interval; the effective license version limits only the optional age window. For license version 1.0, Power User has a 30-day cap and Web Host a 90-day cap. Free has no additional age window; this is neither immediate expiry nor an unlimited paid entitlement. Count and protected recovery-point rules remain independent. An age window of zero adds no age-based retention. Unknown license configuration or a missing/invalid server-derived plan makes policy readiness unavailable while preserving the requested settings and their source.
A platform storage default identifies a physical target. Each customer still needs a separate, owner-bound logical destination and repository; a platform default never lends the platform's repository or credentials. Reads create no owners, repositories or keys. If the binding is absent or key setup in the catalog is incomplete, the effective policy is unavailable and does not pick another storage target. Catalog readiness alone does not prove vault or cloud access.
For LOCAL backups, an enabled effective policy turns on scheduled backups at its interval. Customer administrators change the service and customer values with the schedule routes; there is no automatic deletion yet, and existing operator schedules are unchanged. A resolved policy grants no other operation permission: manual capture, restore and downloads still need a signed-in person with the matching permission, and every request still passes the capture, quota, safety and recovery checks described elsewhere on this page.
Persistent local engine storage
Compose reserves the project-scoped backup_storage named volume at /var/lib/panel/backup-storage for the encrypted engine foundation. Replacing the panel container reuses this volume. Its factory requires the mount root to exist and be operator-owned, rejects symlinks or unsafe permissions, and creates only a private 0700 child. It does not initialize a replacement repository or regenerate a missing password. Existing Backups actions still use legacy/v1 dispatch; this storage preparation does not enable local encrypted captures.
Provisioning a customer's local repository
A platform operator prepares a customer's encrypted local repository with POST /api/v1/backups/local/customers/{id}/provision. Customers and resellers cannot call it, and it is not exposed as an MCP tool. The first call records this installation's identity (Docker daemon, backup volume and the panel container's mount), points the platform backup policy at the shared local destination, creates the customer's repository password (in OpenBao when the vault is configured, otherwise sealed with the panel master key), initializes the restic repository and records the fingerprint of its encrypted configuration. The response carries only identifiers: {customerId, repositoryId, created}.
Each call also measures how much space the repository uses, while no backup can write to it, so a plan with a finite backup storage limit can admit the customer's first backup. If the measurement fails, provisioning still succeeds, the panel logs local backup repository usage not recorded and the audit entry shows usage_known: false. A failed measurement never erases usage recorded earlier. Only when the repository has no current usage on record (for example after its first provisioning) does a finite storage limit refuse backups as if the limit were reached; the portal then shows Back up now as unavailable with that explanation. Provision the customer again to measure it. Usage is not overwritten while a backup or restore is running on that repository; that run records its own.
Calling it again is safe. An existing repository is reopened and its configuration is compared with the recorded fingerprint; it is never re-initialized and never re-keyed. If the comparison fails, the call answers 409 local_backup_repository_mismatch and leaves the repository untouched: investigate before retrying.
One retry is different: if an earlier call was interrupted after the repository was initialized but before its fingerprint was recorded, the next call records the fingerprint of the existing repository (it must decrypt with that customer's own password) and answers created: false. This is crash recovery, not an ordinary reopen; if you did not expect an interrupted first call, check the panel logs before relying on that repository.
Other answers: 404 not_found means the customer does not exist; 409 local_backups_unavailable means the backup volume, the restic engine or the Docker socket is missing; 409 backup_destination_conflict means the platform policy already names another destination; 409 local_backup_repository_conflict means the customer already has a repository created with different settings (for example another key backend); 500 local_backup_provisioning_failed covers storage, vault and engine failures, with details in the panel logs only.
Provisioning prepares storage and nothing else. It never turns automatic backups on, for this customer or for anyone else, and repeating it leaves the platform policy's on/off value as it is. The panel has no operator screen or route for that value: on a new installation it stays unset, so every customer starts at Off and automatic backups start only when a customer administrator turns them on. To let a customer do that, give their plan backupPolicy.
Upgrading from a version where provisioning turned automatic backups on. Earlier versions set the platform policy to on at the first provision call, for every customer with a repository. The upgrade leaves that value alone, because customers may now count on those backups and turning them off silently would end their protection. Their Schedule card keeps showing On with the source Provider. A customer administrator can turn it off with Your default or This service. To return the whole installation to "off until chosen", an operator runs this once against the panel database; it changes the platform default only and keeps every customer's own setting:
UPDATE backup_policy_settings SET enabled = NULL WHERE scope = 'platform';
After the first provisioning call, backup and restore runs on this panel take turns: database, volume and full-snapshot backups, restores and backup deletions share one host slot with local encrypted captures. A run that finds the slot taken waits and tries again a minute later; it is not marked failed. A manual delete answers 409 backup_operation_running; try again shortly. A run whose outcome is unknown (for example the panel stopped mid-restore) keeps the slot until it is resolved. A panel that never provisioned a local repository still runs two backup jobs at once.
Local encrypted captures start only once the panel has confirmed the host is idle. A check that runs every minute moves the installation from provisioning to ready when no backup, restore or deletion is running or unfinished, no backup helper container exists, and no database dump or restore command is still running inside any container. Until then, local capture requests wait; they are not refused. If the panel cannot read Docker or the backup volume does not match the one it recorded, the installation stays in provisioning and the reason appears in the panel logs.
Docker normally stores named volumes under its daemon data root, outside PANEL_DIR. Monitor free space on the actual repository filesystem and Docker data storage; a healthy PANEL_DIR filesystem alone does not establish available backup capacity. Host backup plans must include the repository objects together with consistent panel database and key/vault material. Backing up PANEL_DIR alone is insufficient. Quiesce backup activity and exclude transient .session-* staging from repository or host exports; do not call an inconsistent live volume copy recoverable. Repository objects are encrypted, but staging can contain plaintext capture bytes. This foundation does not supply automated recovery kits or exports.
Preserve this volume during ordinary updates and rollback. Do not remove volumes or use docker compose down -v as an update step. The rollback image must understand migration 98; see the migration compatibility warning below. Deletion or retirement requires a separately reviewed recovery/export plan.
On-Demand Backup
Open the service's Backups tab, select Full snapshot, Database Backup or Volume Backup and create it. A Full snapshot can also run on a schedule (see below). The request queues background work; inspect its status and error.
Which types an app can take. Before anything is created, the panel checks the app and offers only what can work. A refused type is greyed out in the Create Backup menu with the reason, and the API and the run_backup MCP tool answer the same refusal without creating a backup row:
| The app | What you see | API answer |
|---|---|---|
| Has no database, such as Open WebUI or n8n | Full snapshot is disabled: This app has no database, so a Full snapshot does not apply. A Volume Backup captures all its data and can be restored. Take a Volume Backup. | 422 full_snapshot_not_applicable |
| A customer's MySQL, MariaDB, PostgreSQL, pgvector or ParadeDB app deployed before its private network existed | Full snapshot is disabled: Redeploy this app to enable Full snapshots. | 409 full_snapshot_needs_redeploy |
| Runs no PostgreSQL, such as n8n, Open WebUI or a MySQL app | Database Backup is disabled: A Database Backup covers PostgreSQL only, and this app has none. A Volume Backup captures all its data and can be restored. | 422 database_backup_not_applicable |
| Keeps no data in a volume, such as a stateless Git app | Full snapshot and Volume Backup are disabled: This app keeps no data in a volume, so there is nothing to back up. | 422 nothing_to_back_up |
A Full snapshot holds an app's files and its database, captured together, so it needs a database the app's template declares (or managed Directus). For a customer's app it also isolates the database on the app's private network while the dump is taken; an app deployed before that network existed gets it on its next redeploy. The panel reads this with GET /api/v1/services/{id}/backups/eligibility (platform administrators only). A Completed backup row describes stored capture. Its protected operation can still be running or need recovery; wait for the separate recovery status and durable verified result.
Scheduled Backups
Review Retention Policy before configuring automatic backups:
- Open the service's Backups tab.
- Find the database, volume or Full snapshot schedule under Backup Schedules.
- Enter a cron expression and retention in days (the form defaults to 30 days).
- Create the schedule, or save changes to an existing one. An existing schedule also has an Enabled checkbox.
Each service has at most one schedule of each type. A Full snapshot schedule (AI-2378) takes the same snapshot as Full snapshot under Create Backup: the app's containers stop briefly while their volumes are copied, the database is saved next to them, and the app starts again. The app is unavailable for that time, so schedule it for a quiet hour. For an app with its own database and extra stores (ClickHouse, an S3-compatible object store, uploaded files), it is the only schedule that holds those volumes. If the app's Full snapshot is refused (see What Gets Backed Up), no new Full snapshot schedule is offered, as described below. Before this release the form offered database and volume schedules only; the REST route and the MCP tool create_backup_schedule already accepted "backup_type": "full".
Backup Schedules offers a new schedule only for a type the app can take, by the same check as the Create Backup menu above: an app with no PostgreSQL (n8n, Open WebUI) gets no new Database schedule, and an app with no data volume gets none at all, with the reason. A schedule that already exists stays listed so you can remove it. POST /api/v1/services/{id}/backup-schedules and the create_backup_schedule MCP tool refuse an ineligible type with the same codes (422 database_backup_not_applicable, 422 nothing_to_back_up, 422 full_snapshot_not_applicable, 409 full_snapshot_needs_redeploy), so no schedule is stored whose every run would fail.
A schedule stored before that check, or one whose app changed since (for example a Full schedule of an app with no database), is checked again each time it is due. When the app cannot take that type, the scheduler creates no backup and pauses the schedule instead of failing on every run. The audit log records backup.schedule_paused with the code and the reason. Turning a paused schedule back on (PUT /api/v1/backup-schedules/{id} or the update_backup_schedule MCP tool with enabled: true) answers the same code until the app can take that type; remove the schedule, or create one of a type the app supports.
Example cron expressions:
| Schedule | Cron Expression |
|---|---|
| Daily at 2 AM | 0 2 * * * |
| Weekly on Sunday at 3 AM | 0 3 * * 0 |
| Every 6 hours | 0 */6 * * * |
What Gets Backed Up
Database backups now inspect every container belonging to the service, using the template's backup hints, secret annotations and database image names. Each PostgreSQL container contributes:
- one custom-format
pg_dumppart for every connectable non-template database; - one gzip-compressed roles part made with
--roles-only --no-role-passwords; - an engine version and a census of table row counts.
The objects are stored under backups/<owner>/<service-id>/<backup-id>/, with manifest.json written last. Manifest format 1 lists every part's SHA-256 checksum, stored size, database and container, plus the service's owner and ownership generation at capture. The backup completes only after every command, upload and manifest write succeeds. A service ownership change during capture prevents completion. Partial uploads are deleted; keys remain recorded if cleanup fails, so deletion can be retried. The displayed size counts the stored parts, excluding the manifest.
Database-only restore remains unavailable. A capture manifest alone does not grant restore capability. A new supported full snapshot requires a separate verified recovery descriptor; existing captures do not become restorable after an upgrade. Existing one-object backups stay in the old format and remain accessible through storage and the internal download service. There is no new HTTP download action.
MySQL, MariaDB, MongoDB and Redis/Valkey are detected but refused explicitly: the backup fails rather than complete without that data. One exception: a Redis/Valkey container that the template marks ephemeral (a cache or job-queue broker whose data is safe to lose, such as Dify's) is listed in the manifest's skipped entries with kind ephemeral-database, nothing runs in it, and the PostgreSQL databases are dumped as usual. After a restore of such a service the cache starts empty: queued background jobs are gone and users may need to sign in again. A standalone Redis or Valkey service, or a Redis found only by its image, still has no working backup. A missing or stopped database container also fails capture. PostgreSQL tools connect over the container's local socket at /var/run/postgresql, without a password; images requiring password authentication or another socket path fail rather than capture another server. The user comes from the template annotation or POSTGRES_USER (default postgres). File-only user/database settings remain unsupported. Application writers are not stopped by a database-only backup: each dump has its own consistent snapshot, while the census is measured separately. These parts are not a synchronized whole-service recovery point when external writers are active.
Application-volume backups
A volume backup captures every owned named application volume, using the actual mounts of all service containers rather than assuming /data. An owned volume currently mounted by no container is included too. Sharing inside the same service produces one part with each consumer's mount destination recorded. A foreign consumer blocks capture even when it is stopped. Unlabelled or anonymous volumes, host bind mounts, subpath mounts, shared/external drivers and local volumes with driver options are refused. Transient tmpfs mounts are recorded as excluded storage.
This path is for services without a database. Database images, template database hints, database credential annotations and database environment signals refuse files-only capture. A service with PostgreSQL and application files needs Full snapshot; selecting Volume does not silently omit its database storage. Missing template metadata also refuses capture rather than ignoring its hints. skipVolumes remains reserved and does not exclude volumes in this version.
Running application containers stop for the entire capture; intentionally stopped containers stay stopped. The worker first validates each archive and its file census, then streams a second validated archive into a gzip-compressed manifest part. It preserves numeric ownership, modes, symbolic links, hard links, POSIX access ACLs and user extended attributes, while refusing special files and escaping archive paths. A symbolic link is kept as a link whatever it points at, including absolute targets into the app image (OpenClaw links plugin-skills/* into /app/dist); nothing in the archive may be stored inside or in place of a link. Each part records the actual volume identity, mount consumers, helper image ID, file counts, logical bytes and stored-byte checksum. Stored capture completion is recorded before the paired operation finishes its remote-work cleanup, restart and readiness checks. The backup row can therefore say Completed while recovery is still running or needs attention. The operation resolves only after those checks succeed; a durable verified operation result, rather than the capture status alone, establishes that resolution.
Capture uses a pinned helper image with no network, read-only root and a single read-only volume. The current helper uses a frozen official Debian sid image; sid is an unstable release channel. Backup maintainers revalidate replacement digests on both supported architectures and migrate to a stable official image once it passes the same vulnerability and archive-fidelity checks. Operators may set BACKUP_HELPER_IMAGE to an immutable repository digest or image ID; floating tags are refused. The image must be cached or explicitly pulled and pass the GNU tar capability probe before any application stops. A failed helper, upload or cancellation fails the run and attempts bounded restart cleanup. A helper or restart that cannot be cleaned up retains the operation journal for retry. After a panel interruption the reconciler removes only that operation's helpers before restarting its journalled application containers.
Neither database nor volume backups export Compose, environment, plan or deployment history as a complete service recovery bundle. Database-only captures remain unsupported for panel restore. A volume capture is restorable when its files pass the restore extractor's checks; see Restorable volume backups. The restore extractor has narrower metadata limits than capture.
A volume backup of a service with a database engine fails before anything stops, with the message this app runs a database engine, so its volumes cannot be backed up as plain files; use a full snapshot where the app supports it. For an app whose database is PostgreSQL, MySQL or MariaDB, take a Full snapshot instead; see Restorable Full snapshots of apps with a database.
Older database backups may contain Docker framing, or the empty default postgres database rather than the application's data. Take a new backup after upgrading and inspect its manifest.
Limits and timing
- A backup or restore job may run for up to 6 hours. (Before, any job that ran longer than one minute was cancelled.) Uploads go in 64 MiB parts, so a running backup holds about 64 MiB of memory in the panel.
- A standalone Volume Backup keeps its 50 GiB per-volume logical-data and raw-archive limit, including its ACL and user-extended-attribute capture support. It has a two-minute preflight census deadline, and a ten-minute stream inactivity timeout. More than one million entries, paths over 4096 bytes or excessive archive metadata fail capture. Special-file warnings also fail rather than reporting an incomplete archive as completed.
- Full and safety snapshots use smaller verified-restore budgets. Each stored part must fit within 128 MiB, the sum of recorded uncompressed part sizes within 256 MiB, and each application-volume inventory within 10,000 entries. The strict metadata refusals described below apply to this strategy. These limits do not reduce standalone Volume Backup capture to the full-snapshot subset.
- At most two backup or restore jobs run at the same time on a host, and only one per service: a backup or restore of a service that already has one running fails at once with "a backup or restore of this service is already running" and changes nothing. A backup job runs once; the next scheduled run is the retry.
- Backup and restore jobs have their own job queue (a second set of job tables in the database schema
river_backup). They still appear under Settings → Jobs. A backup or restore that was still waiting in the old queue when the panel was upgraded is cancelled at start-up, with an audit entry and a backup notification; such a backup showsfailedwith "queued before the upgrade; start it again". - A restore stops and starts again only the service's containers that were running when it began. A container you stopped stays stopped, and a restore of a service that is stopped completely is refused: start it first.
- If the panel stops during a run (crash, out of memory, an update), the stopped containers and remote executions are recorded. Legacy database captures use bounded restart cleanup and report interruption. Quiescing volume/full capture and restore retain a paired operation until remote work is proved dead, recorded network connections and services are safely resumed, or explicit recovery resolves partial application. A stale heartbeat is insufficient to resume writers. Check the Backups tab’s recovery state; do not assume a panel restart means the service is safe to restart manually.
Storage Targets
Service backups go to one S3-compatible bucket (AWS S3, MinIO, Backblaze B2, DigitalOcean Spaces and similar), encrypted before they leave the panel. A platform administrator sets it in one of two places:
- Backups → Storage (formerly Settings → S3): endpoint, bucket, access key, secret key and Use SSL. The endpoint may be typed as a host (
s3.example.com,minio:9000) or as a URL (https://s3.example.com); with a URL, itshttp/httpsdecides HTTPS instead of the checkbox. Do not put the bucket in the endpoint path. Changes take effect for the next backup, without a panel restart. - Environment variables
S3_ENDPOINT,S3_ACCESS_KEY,S3_SECRET_KEY,S3_BUCKET(defaultaiadminpanel-backups) andS3_USE_SSL(falseturns HTTPS off). WhenS3_ENDPOINTis set it wins over the form on Backups → Storage, and the form says so.
The secret key is write-only: the panel stores it encrypted, never shows it again and never returns it from the API. To keep the stored key, leave the field blank when you save; type a new one to replace it.
Test connection on Backups → Storage writes a small file under aap-connection-test/ in the bucket, lists it and deletes it, within 15 seconds. It reports which of the three steps failed. A backup needs all three (writing the archive, and listing and deleting for retention).
While no target is set, backups are off: the service's Backups tab and Backups → Storage say "Backups are off: no storage target configured", creating a backup, a schedule or a restore is refused with 409 backups_not_configured, and due schedules and retention cleanup wait until a target is set. Existing backup records stay visible. There is no local-disk backup target; never put live storage credentials in tickets.
Changing the storage target does not move existing backups. Each backup records the endpoint and bucket it was written to. After you change the endpoint or bucket, or set or unset S3_ENDPOINT, older backups stay in the list, and restoring or deleting one is refused with 409 backup_storage_mismatch: "this backup is stored in bucket "…" at …, which is no longer the configured target". The Backups tab shows a localized storage-target explanation and refreshes the storage status after this error. Retention skips them the same way, so their files are not left behind in the old bucket without a record. Set the old target again to restore or delete them, or copy the files to the new bucket yourself. Backups made before targets were recorded have no recorded target; they use the target set now, as before.
Storage errors shown in the panel (Test connection, a failed backup, audit entries, notifications) name only the S3 error code, the HTTP status or the kind of connection problem. They never repeat what the endpoint sent back, so a wrong endpoint pointing at some other service cannot show that service's replies.
The RustFS template deploys an S3 target you can use; on the same server it is a convenience copy, not off-site protection.
Encryption of the S3 storage target
Every object the panel writes to the S3 storage target is encrypted before it leaves the panel (AI-2457): backup parts, manifests and single-file backups. Someone who can read the bucket (the storage provider, a leaked access key, a bucket made public by mistake) sees only encrypted files and their names and sizes. All other kinds of backup storage were already encrypted: this server's disk, customer-owned storage, platform backup storage and cloud drives keep backups in encrypted restic repositories, each with its own password in the vault.
How it works:
- The format is age, a small, published format for encrypting files. Each object gets its own random key, which is locked with the installation's backup key. Every 64 KiB of an object is authenticated, so a changed or cut-off object does not decrypt.
- The backup key is one per installation and lives only in the vault (OpenBao), in the platform's backup namespace. It is created at the first backup after the upgrade and never replaced. It is not in the environment, the panel database or the bucket, and no API returns it.
- Without the vault, new backups to the S3 target are refused rather than written in clear text. A backup that cannot read the key fails with "the backup encryption key in the vault is unavailable". This includes installations that run with
SECRETS_BACKEND=file. Backups to this server's disk are not affected. - What restore checks. A backup encrypted with another installation's key, or an encrypted object that was changed or cut off in the bucket, fails with "the backup could not be decrypted with this panel's key". Backup parts and manifests are also checked against the SHA-256 the panel database recorded for them, so a replaced part or manifest is refused even if it is not encrypted. Single-file backups (older database-only backups) have no recorded hash yet: if someone with write access to the bucket replaces one with an unencrypted file, the panel does not refuse it yet. That check is planned (AI-2466).
Backups made before this release are not encrypted and stay as they are. They keep restoring and downloading as before; the panel recognizes them because they do not start with the age header, and needs no key for them. They are not re-encrypted in place. Every new backup, scheduled or manual, is encrypted, so the old clear-text backups disappear from the bucket as your retention period deletes them. To get rid of them sooner, take a new backup of each app and then delete the old ones on the app's Backups tab. A safety snapshot taken before a restore is a new backup and is encrypted too.
Keep the key safe: losing it means losing the S3 backups. The key is in the vault, so it is in every nightly infrastructure backup set made after the first encrypted backup, and the vault's recovery key opens those sets. Nothing copies the sets off the host. If the server is lost with its sets, the encrypted backups in the bucket cannot be read, by an attacker or by you. To be able to recover from the loss of the whole server, copy a recent set (after the first encrypted backup) to a protected place off the server, and keep the vault's recovery key offline, apart from it.
What the bucket can still see: object names (they contain the customer, service and backup IDs), sizes and times. The panel does not use the provider's own server-side encryption; you can turn it on as well, it does not change anything here.
Restoring from Backup
Supported full snapshots
The first verified strategy supports a normally deployed managed Directus service with one matching PostgreSQL 16 container, the existing directus database and roles, and owned application files such as uploads. The service must still have the matching database engine/image identity, attributable local named volumes and supported private-network topology. Other engines, external databases, shared or foreign volumes, bind mounts and unsupported topologies are refused. A completed database-only, files-only or legacy backup does not gain restore capability just because the panel was upgraded. Volume backups use their own strategy, described next.
Services assigned to a customer
A platform administrator can take a Full snapshot of a service assigned to a customer and restore it. The snapshot records the owner it was taken under: the customer and the service's current owner generation, which changes on every assignment, unassignment and reassignment. Restore is offered only for a snapshot taken under the service's current owner. A snapshot from before the current assignment is refused with the reason taken under a previous owner (API: 409 restore_owner_changed). This includes a snapshot from when the service was unassigned, one taken for another customer, and one taken for the same customer before the service was unassigned and assigned back to them. The panel never infers a snapshot's owner from today's assignment. The mandatory safety snapshot and any undo are bound to the same customer and generation. Only platform administrators can do this; customers restore their own LOCAL backups in the portal (see Customer LOCAL backups).
A customer's database app that runs in one container (PostgreSQL, pgvector, ParadeDB, MySQL, MariaDB) is deployed with a second, internal network of its own, as an app with several containers always is. The Full snapshot isolates the database on that network; the app keeps its place on the customer's network for its normal traffic, and the customer's other apps reach it by the same <project>-<service> name as before. Such an app deployed before this change has no such network: its Full snapshot is refused with redeploy this app to enable Full snapshots. Redeploy it once (service page → Redeploy); its data volume is kept.
A full snapshot captures logical PostgreSQL data and application files under one operation and one application pause. It accounts for every mount and excludes raw PostgreSQL data only after proving logical coverage. Intentionally stopped application containers remain stopped. Access to this service is interrupted during isolation; the panel restores only its recorded peer connections and originally running applications.
The restore extractor accepts regular files, directories, safe relative symbolic links and in-volume hard links with numeric ownership and ordinary modes. It refuses ACLs, extended attributes, file capabilities, sparse files, special files, setuid/setgid bits and unsupported archive metadata before changing data. Files-only capture can preserve ACLs and user extended attributes, but this does not mean the first full-snapshot restore strategy accepts them. The same applies to symbolic links with an absolute target or one outside the volume: a volume backup keeps them, but a full snapshot refuses such a volume, because the restore extractor only recreates links that resolve inside it. Restore keeps existing database roles and passwords; it never replays the captured roles SQL. Missing required roles refuse restore. This is not a replacement of the whole PostgreSQL instance. Tables outside the snapshot are kept; a verified restore or safety-undo result shows their retained count when it is nonzero.
Restorable volume backups (files-cold-v1)
A Volume backup of an app that runs no database engine, for example n8n (SQLite and its encryption key in /home/node/.n8n) or OpenClaw, can be restored. The capture is cold: running application containers stop for the capture, so a database file and its -wal journal are copied in a consistent state, and only the containers that were running start again. When the capture is stored, the panel checks every volume archive against the restore extractor and its limits. If they pass, the backup is restorable; if not, the backup still completes and stays a valid backup, and the restore control explains This volume backup cannot be restored (API reason capture_not_restorable). Causes are:
- the volumes are larger than the restore limit (128 MiB stored per volume, 256 MiB of files in total, at most 16 volumes) or hold too many files;
- a volume contains files or metadata the extractor cannot restore faithfully: ACLs, extended attributes, file capabilities, setuid/setgid bits, device files, or a file stored inside or in place of a symbolic link;
- the backup was taken before this release. Take a new volume backup.
Symbolic links are restored as links with their exact target text, also when the target is absolute or outside the volume, such as OpenClaw's links into /app/dist in its image. The restore never follows or resolves a link; it compares each restored link's target text with the backup. (A full snapshot keeps the stricter rule and refuses links that leave the volume.)
Restore runs the same protected operation as a full snapshot. Before changing anything the worker verifies the backup's bytes and checks that the service still has the same containers, images and volumes as at capture; a redeployed service (new containers) or an added volume refuses the restore, so take a new backup after redeploying. It then stops the app, takes a mandatory Safety snapshot as a volume backup of the current data, clears and replaces every volume, checks every file's content, owner and mode, and starts the containers that were running. If the safety snapshot itself could not be restored, the restore stops before changing data and the app starts again.
Restoring an S3 volume backup is platform-only. For a service assigned to a customer, only a volume backup taken under the current owner is offered (see Services assigned to a customer). Customers restore their own LOCAL volume backups in the portal with the same verified restore (see Customer LOCAL backups). If the app reads its encryption key from an environment variable (for n8n, N8N_ENCRYPTION_KEY), the restored data needs that same key.
Restorable Full snapshots of apps with a database (app-db-logical-v1)
A Full snapshot of a template app whose database runs in PostgreSQL, MySQL or MariaDB can be restored, for example Ghost (MySQL), Outline, Paperless-ngx or Twenty (PostgreSQL), and the PostgreSQL, MySQL and MariaDB templates themselves. The template declares which container holds the database and which engine it runs; the panel uses that, and refuses a database image the template does not declare. (Directus keeps its own pg16-files-v1 snapshot, described above.)
Capture. The app's containers stop; the database containers keep running, alone. The panel checks that no other client is connected, counts every table's rows, and takes each database's native logical dump inside its container: pg_dump --format=custom for PostgreSQL, and mysqldump or mariadb-dump with --single-transaction --routines --triggers for MySQL and MariaDB. Each dump is stored as one part next to the app's own volumes, and the part records the engine and its version. The database's data volume is not copied as files, because the dump replaces it. A database container may mount only that one named volume: one that mounts a second (Supabase keeps its encryption key in /etc/postgresql-custom) is refused, because the dump would not contain it and the snapshot would silently lose it. The app's other volumes are archived and checked like a volume backup (links are kept literally). The app then starts again.
ClickHouse, object stores and caches are copied as files (AI-1969). Only the containers the template declares as its database are dumped. Every other container counts as part of the app: a ClickHouse server (Langfuse's traces), an S3-compatible object store such as RustFS (Langfuse's raw events, AppFlowy's attachments), or a Valkey cache the template marks disposable. It is stopped with the app, with up to 30 seconds to shut down, and its volume is copied after it has stopped. So a Full snapshot of Langfuse holds the PostgreSQL dump plus the langfuse_clickhouse, langfuse_s3 and langfuse_redis volumes, and the same holds for the uploaded-files volumes of Twenty, Docmost, Immich, Chatwoot, Relaticle, Outline, Paperless-ngx, Kestra, Sim and Maxun. ClickHouse is not backed up with its own BACKUP command, and the panel does not check its tables after a restore. ClickHouse data grows quickly, so a Langfuse snapshot often goes over the restore limits below. It is still taken and can be downloaded, but it cannot be restored from the panel.
Other backup types do not copy these volumes:
- A Database backup (the type a new schedule gets unless you choose another) holds the PostgreSQL dumps only.
- A Volume backup of an app that runs a database (ClickHouse included) is refused.
- A customer's LOCAL backup in the portal fails with
database_engine.
The schedule form on the Backups tab offers Database and Volume schedules only. To copy these files on a schedule, create a Full snapshot schedule through the API (POST /api/v1/services/{id}/backup-schedules with "backup_type": "full") or the MCP tool create_backup_schedule.
Three templates have no backup in the panel at all yet. Opik and AppFlowy keep data that must not be lost in a Valkey store, and the panel has no Valkey dump. OpenLIT declares no database, and its traces are in ClickHouse, so a Volume backup refuses it. Copy their volumes yourself while the service is stopped.
Restore.
- The worker verifies the backup's bytes and owner, and checks that the service still has the same containers, images and volumes.
- It checks the database engine. A restore into an older database version, or into another engine, is refused before anything stops, for example This backup was taken with MySQL 8.4; the app now runs MySQL 8.0. Restoring into an older database version is refused. PostgreSQL compares the major version (16, 17), MySQL and MariaDB compare major.minor (8.0, 8.4, 11.4). A newer version is fine.
- It stops the app and takes a mandatory Safety snapshot of the same kind.
- It replaces the app's volumes, then loads each dump into its running database container.
- It compares the row count of every table with the backup.
- It starts the app and waits until the app is ready.
PostgreSQL loads each database in one transaction, so a failed load leaves that database as it was. A MySQL or MariaDB load cannot be one transaction: if it fails part-way, the database can be left half restored. The operation then stops with Recovery needs attention. Use Undo using safety snapshot to put the app back as it was before the restore.
Credentials. The panel never reads or stores a database password for this. PostgreSQL commands use the database container's local socket. MySQL and MariaDB commands run inside the database container and take the password the container was started with from its own environment (MYSQL_ROOT_PASSWORD, MARIADB_ROOT_PASSWORD, or the app user's *_PASSWORD). If the container has none, the snapshot fails with the database container exposes no credentials the backup can use.
Limits. A restorable snapshot has at most 16 parts (dumps and volumes), at most 128 MiB stored per part and 256 MiB of data in total. A larger snapshot still completes and stays downloadable, and the restore control says This backup cannot be restored (API reason capture_not_restorable).
Not covered yet. MongoDB, a Redis that the template does not declare as a disposable cache, and other engines: a Full snapshot of such an app fails before anything stops, naming the engine, for example this app runs a database engine this version cannot restore (mongodb). ClickHouse has no engine of its own: it is copied as files, as described above. Customers' LOCAL backups of database apps in the portal are not restorable yet either; they fail with database_engine as before.
Owner scope is the same as for every other restore: only a snapshot taken under the service's current owner and owner generation is offered, and an older one answers 409 restore_owner_changed.
Restore in the panel
- Open the service’s Backups tab and choose Create Backup → Full snapshot (an app with a PostgreSQL, MySQL or MariaDB database, or managed Directus) or Create Backup → Volume Backup (an app without a database engine).
- Wait for stored capture and its protected operation to finish. Inspect errors or recovery attention states. Completed in the backup row can appear before cleanup, restart and readiness finish; it describes stored capture, not a resolved operation or successful restore. When capture fails before applying data, failure cleanup allows the full 90-second application readiness window within a finite 150-second drain, restart and resolution budget. A restart failure still retains recovery protection and requires an offered explicit continuation.
- Use Restore only when the server offers it for that backup. A disabled control includes a reason, such as unsupported format, taken under a previous owner, incomplete capture or storage mismatch.
- Read the warning and type the service name to confirm. The request is queued; this does not mean the data has been restored. The list polls while waiting for the worker and while capture or recovery is running. During the initial wait, backup actions are disabled. If no matching result or active operation appears within one minute, an outcome not verified notice offers Refresh status. Retry only an action the server offers; a retry is a new request and never happens automatically.
- Wait for the durable verified recovery result. The panel shows the last verified restore result with its completion time; an idle state alone does not establish success. This history belongs to the service and appears on every backup row; it does not mean that the particular row’s backup was restored. The retained-extra-table count belongs to that historical service recovery too.
Before application data changes, the worker downloads and validates all source parts, checks checksums, sizes, ownership, the configured destination and current runtime topology, then creates a mandatory Safety snapshot of the current data. There is no skip-safety option. The source row links to it with View safety snapshot; the link opens this service’s Backups tab and focuses the corresponding row. After applying data, the worker checks file contents and metadata and, for a full snapshot, the row census of every database, then restarts the recorded applications and checks readiness. Transactions cover individual databases, not the entire set of databases and files.
Recovery and safety undo
A failed or interrupted operation may leave application data partly replaced. The list separates Recovery needs attention from Readiness failed after restart. After a restart, services may already have accepted new writes; the panel does not claim they stayed paused. It retains its operation and protected artifacts until recovery is resolved.
Use only an action the server explicitly offers, and confirm it by typing the service name:
- Resume services before apply applies no backup data. The worker must first prove the old attempt and its remote work have ended before restoring the recorded service access.
- Undo using safety snapshot first pauses writers again, rechecks ownership and topology, and restores the original mandatory safety snapshot under the retained operation. Writes made after services restarted will be replaced by the safety snapshot. Undo is explicit; readiness failure never automatically authorizes it. It does not create another safety chain.
If no action is offered, contact the platform operator. Do not manually restart services, change the storage target, delete artifacts or clear operation claims. A stale heartbeat alone does not authorize recovery. An unavailable worker refuses queueing rather than claiming work was accepted. A queued recovery is complete only when its durable result says so.
Docker may remove records for older completed recovery commands. The worker accepts an absent command only when its journal already proves it finished and a fresh Docker read confirms the same full container ID. It still checks that recovery database sessions have ended before resuming writers. An unfinished command or uncertain identity keeps recovery protected.
After a successful restore, restoring its retained safety backup is a normal restore and takes a new mandatory safety snapshot. Hourly retention keeps every safety record for at least three days. Within the current service-owner generation it also keeps the newest three safety records overall and the newest three verified completed copies on each storage destination, so failed copies cannot displace good undo copies. With one destination this can retain up to six older records; recent copies, other destinations and unresolved operations can retain more. Unresolved operations protect their source, safety artifacts and storage destination regardless of age. Safety copies kept in a customer's local backup repository are outside this hourly expiry. Automatic expiry leaves earlier ownership generations and backups on a different configured destination untouched. A database or volume schedule never expires Full snapshots; only a Full snapshot schedule does (see Retention Policy).
The API reports availability as recovery.supported and separate allowed recovery.actions; IDs or recovery state never grant action authority. POST /api/v1/backups/{id}/restore and POST /api/v1/backups/operations/{id}/reconcile return 202 for accepted requests only. A 409 refusal can mean an operation is active, recovery needs attention, continuation is unavailable or the pinned storage target differs. Refresh the list for the current explanation. Restore and recovery writes are platform-only; customer and reseller responses expose no actions.
Restoring a database backup by hand
For a backup outside the panel’s supported subset, a PostgreSQL database backup can be put back by hand. This replaces the database's current contents, so first make a copy of the current data, and try it on a scratch database before you touch the real one.
Download
manifest.jsonand its database part from the configured S3 bucket. Check the part's SHA-256 and byte size against the manifest before using it.Identify the PostgreSQL container and database from the manifest, and obtain the user from the template annotation or container configuration (the manifest does not store it). Make a separate copy of current data and stop application writers before a live restore.
Create an empty scratch database and restore the
.pgdumpcustom-format part:docker exec -i <db-container> pg_restore -U <user> --single-transaction --dbname=<scratch-database> < database.pgdumpQuery a known marker and compare table row counts with the manifest census. Test application behavior before using the same procedure for live recovery. Restore roles only after reviewing the roles SQL; existing credentials should remain current.
A legacy .sql.gz object requires its own format inspection: older versions may have stored plain SQL despite the extension, an empty database, or Docker framing. The panel cannot certify it for restore. Legacy volume objects contain only the former first-container /data path. New volume parts contain relative archive paths from each named volume; validate the manifest checksum and inspect them in an isolated scratch volume before designing a manual recovery procedure.
Backup Management
Viewing Backups
Open a service's Backups tab to see its backup type, status, size, date and any available actions. Keep an independent recovery inventory; this list is not an infrastructure backup catalog.
Retention Policy
The service's Backups tab stores a retention period in days for each Full snapshot, database or volume schedule. The form defaults to 30 days. It does not offer count-based or combined daily/weekly retention rules.
Each schedule's period applies only to backups of its own type. A volume schedule with a 7-day period deletes volume backups older than 7 days; it never deletes the service's database backups, which follow the database schedule's period. Backups you create by hand count as the type you chose, so the schedule of that type also removes them once they are past its period. A Full snapshot schedule removes manual and scheduled Full snapshots only: Safety snapshots keep their own three-day policy. Customers' LOCAL backups are never removed by any schedule's period; LOCAL retention removes them. Before this release a Full snapshot schedule created through the API made every hourly cleanup run fail and never removed a snapshot (AI-2378), and so did a volume schedule on a service with an old customer LOCAL volume backup (AI-2380).
- When cleanup runs. A separate job runs every hour and applies every enabled schedule, whether or not it is due to back up at that moment. A disabled schedule deletes nothing: backups of a type whose schedule is disabled are kept until you delete them.
- The newest good backup is always kept. Cleanup never deletes the newest completed backup of a service and type, however old it is. If a schedule keeps failing (storage full, a stopped service), you keep its last good backup instead of losing them one by one. The panel log then shows
retention: kept newest completed backup past its window, a sign that the schedule has stopped producing backups. Failed backups never count as good. - When cleanup fails. If the panel cannot read the schedules, the hourly run is recorded as failed under Settings → Jobs instead of "0 deleted".
- When a file cannot be deleted. If storage refuses to delete a backup's file (unreachable, permission denied, rate-limited), the backup is kept and its status becomes Delete failed, with the storage error shown under it for platform admins (other accounts see "Storage refused the delete."). The hourly run is recorded as failed under Settings → Jobs and is not retried in between; the next run retries every Delete failed backup of the schedule's type, whatever its age; when the file is already gone the retry just removes the record. Before, the record was dropped and the file stayed in the bucket with nothing left pointing at it.
- Large backlogs. One cleanup run may take up to 30 minutes. A backlog that needs longer is finished by the following hourly runs; nothing is deleted twice.
- Only completed backups (and Delete failed ones, for the retry) are deleted. Backups stored on a target that is no longer configured are kept (see above).
Keep an independent copy outside the panel-managed backup set for your required recovery window. Ask your hosting administrator to review existing schedules and preserve needed archives before relying on automatic retention. Matching the periods alone does not prove backup completeness, timely cleanup, or recoverability; the restore eligibility limits still apply.
Manual Deletion
Individual backups can be deleted from the backup list. Active or unresolved recovery references block deletion and retention before any stored object is removed; referenced artifacts remain protected until the paired operation is resolved. The panel deletes every recorded part and the manifest (or the single legacy file) before removing the record. A partially successful delete retains all keys so a retry also handles objects already gone. If storage refuses, the delete answers 502 backup_delete_failed, the backup stays in the list as Delete failed with the storage error (platform admins only; other accounts see a generic reason), and the attempt is audited as backup.delete_failed. Delete it again once storage works; a schedule of the same type also retries it within the hour. Deleting is refused while backups are off (409 backups_not_configured), for a backup stored on another target than the current one (409 backup_storage_mismatch), and for a backup kept in a customer's local backup repository (409 backup_retained_locally); the record and its data are kept. A local backup has no file on the storage target, so deleting it here would remove only the record and leave its snapshot behind with nothing pointing to it.
When a customer is deleted
Deleting a customer does not delete the LOCAL backups the panel kept for it on this server. In the same database transaction that removes the customer, the panel marks the customer's backup owner as retired and records the time and the customer's name (company name, or first and last name). That record stays after the customer is gone, so the backups can still be found, exported and finally purged. Nothing is purged automatically.
Platform operators see these owners under Backups → Emergency & cleanup → Deleted customers' backups. The section is hidden for everyone else: the routes answer 404 to any caller that is not a platform operator, and a platform operator also needs backups.admin.
- Export, for 30 days after the deletion. Export prepares one
.tarwith every backup snapshot of that customer on this server. Each snapshot folder holds its manifest and its parts; every part is checked against its recorded SHA-256 while the archive is built, and a mismatch fails the export. A snapshot whose manifest belongs to another owner or cannot be read is left out and listed in the archive'sindex.json. AREADME.txtexplains the layout. The archive is offered for 24 hours, then deleted; only one export per customer is prepared or downloadable at a time (409 offboarding_export_exists). After the window, export answers409 offboarding_window_ended. - Purge, only after the 30 days. Purge asks for the customer's name to be typed (or the owner id when no name was recorded); a wrong value answers
422 offboarding_confirm_mismatch, and a purge inside the window answers409 offboarding_window_open. The panel deletes each repository directory, then the repository's password in OpenBao (when the vault holds it), marks each repository purged and deletes any export archive. Purging is irreversible. If the panel stops halfway, the owner shows Purge in progress and Finish purge resumes it; a repository already removed counts as done. Calling purge again for a purged owner answers200withpurged: true.
Export and purge run in the background, one at a time per host, and never at the same time as a LOCAL backup or restore. Every request, download and completed purge is audited (backup.offboarding_export_requested, backup.offboarding_export_downloaded, backup.offboarding_purge_requested, backup.offboarding_purged). Routes: GET /api/v1/backups/local/retired-owners, POST /api/v1/backups/local/retired-owners/{id}/export, GET /api/v1/backups/local/retired-owners/{id}/exports/{exportId}/download and POST /api/v1/backups/local/retired-owners/{id}/purge. Export, download and purge are not MCP tools.
Customers deleted before this upgrade. Migration 000110 retires every customer backup owner whose customer was already deleted. The deletion time is unknown, so the 30-day window starts at the upgrade, and no name is recorded: the list shows Name not recorded and purge is confirmed with the owner id.
Infrastructure Backup
Service backups do not cover the panel database, Keycloak, the bundled AI gateway, OpenBao, or host configuration. Those are covered by a separate nightly backup on the host.
What the nightly backup covers
The installer enables a systemd timer, aap-backup.timer, that runs daily at 03:00 host time. An existing installation gets it by running the installer with --refresh-updater. Each run writes one folder, /opt/aiadminpanel/backups/set-<UTC time>/, with:
- a copy of the OpenBao vault (the store for customer secrets),
- a dump of the panel database and of the Keycloak database,
- a dump of the bundled AI gateway's
litellmdatabase (its virtual keys, budgets and spend records), left out only on a server that has no such database, - a manifest with a checksum of every file and the fingerprint of the vault's unseal key.
OpenBao is stopped for a few seconds during each run. In that window vault-backed secret reads and deployments fail and retry. Sets older than 7 days are deleted; the newest is always kept.
What it does not cover
- The unseal key is kept apart from the sets, in
/opt/aiadminpanel/secrets/openbao_unseal_key.d/. A set without its key cannot be read, by an attacker or by you. How well the key itself is protected depends on the host; see "The vault's unseal key" below. - Nothing copies the sets or
/opt/aiadminpanel/secrets/off the host. If the host is lost, both are lost. On a host whose key is encrypted, keep the recovery key offline (below). On a host whose key is not encrypted, copysecrets/to a separate protected place yourself, apart from the sets. - The database dumps are not encrypted. They contain Keycloak password hashes and secrets. The sets are readable by root only; do not copy them anywhere less protected.
If you scheduled backup-databases.sh with your own cron job before, remove that job: it would stop the vault twice a day.
The vault's unseal key
OpenBao opens itself at every start with an unseal key stored on the server. On a new installation that key is encrypted with systemd-creds, so it opens on this server only. A clear copy exists only in memory while the server runs.
| Mode | What a stolen copy can do |
|---|---|
host+tpm2 (the server has a TPM2 chip) | A copy of /opt/aiadminpanel, of the whole disk or a provider snapshot cannot open the vault. |
host (no TPM2, most virtual servers) | Partial protection. A copy of /opt/aiadminpanel cannot open the vault. A copy of the whole disk or a provider snapshot still can. |
clear (installations from before this change, Ubuntu 22.04) | Any copy of the disk or of /opt/aiadminpanel can open the vault. |
Root on the running server can always read the key. See which mode you have with sudo aap-openbao-key status.
The recovery key. At the end of a new installation the installer shows the recovery key once (or, when its output is not a terminal, the command to print it). Store it offline: a password manager or paper, never on the server. It is the only way to open your vault backups on another server, or after the TPM2 chip is reset. Print it again at any time with sudo aap-openbao-key export; put it on a new server with sudo aap-openbao-key import <file>.
Existing installations keep the clear key until you run sudo aap-openbao-key protect. It shows the recovery key, waits until you type SAVED, encrypts the key, checks that OpenBao opens with it, and only then deletes the clear key. OpenBao restarts once (a few seconds). Get the command first with install.sh --refresh-updater. Ubuntu 22.04 cannot encrypt the key (its systemd-creds is too old) and keeps the clear key.
Restoring
A restore puts the vault and the databases (panel, Keycloak and AI gateway) back as they were at the time of the set. Anything written since is lost, including secrets entered and customers created after the backup. The panel is stopped during the restore. Follow the "Restore" section of the repository's docs/runbooks/openbao.md step by step: it restores the databases from the set, then runs /opt/aiadminpanel/restore-openbao.sh <set> --yes for the vault, which refuses to change anything if a checksum, the unseal key or the OpenBao version does not match. Do not run live stop/copy/restore commands merely to verify this page.
Selecting backup permissions in Roles
Platform role administrators load the selectable UUID catalog through GET /api/v1/permissions, requiring settings.roles_manage. The same read is available as the platform-only list_permissions MCP tool. The labels shown in expanded role details and create/edit forms are translated; submissions retain the original permission UUIDs. A stored grant on a constrained tenant role does not override the platform-only catalog boundary. A role's backup permissions, together with the customer's plan, decide which portal backup actions a customer login gets.
The default Reseller role holds backups.view and backups.own_destination (owner decision 2026-10-30, AI-1645): resellers may use their own backup storage, and their plan caps the kinds their customers can connect. It holds no other backup action.