Skip to main content

Backup and Restore

AI Admin Panel provides backup and restore capabilities for deployed services. Backups capture service data, configuration, and volume contents.

Backup Types

On-Demand Backup

Trigger a backup at any time from the service detail page:

  1. Navigate to the service
  2. Click Actions > Backup
  3. The panel creates a backup job that runs in the background
  4. Progress is shown in real time via WebSocket
  5. Once complete, the backup appears in the backup list

Scheduled Backups

Configure automatic backups on a schedule:

  1. Navigate to Settings > Backup
  2. Enable scheduled backups
  3. Set the schedule (daily, weekly, or custom cron expression)
  4. Set retention policy (number of backups to keep)
  5. Click Save

Example cron expressions:

ScheduleCron Expression
Daily at 2 AM0 2 * * *
Weekly on Sunday at 3 AM0 3 * * 0
Every 6 hours0 */6 * * *

What Gets Backed Up

For each service, the backup includes:

ComponentMethodDescription
Docker volumesArchiveTar archive of all named volumes
Database dataNative dumppg_dump, mysqldump, mongodump for known database services
Service configExportDocker Compose file, environment variables, Traefik labels
MetadataJSONService record, customer, plan, deploy history

Database-specific backups use native tools for consistency:

  • PostgreSQL: pg_dump (SQL format)
  • MySQL/MariaDB: mysqldump (SQL format)
  • MongoDB: mongodump (BSON format)
  • Redis: RDB snapshot copy

Storage Targets

Local Storage

By default, backups are stored locally at /opt/aiadminpanel/backups/:

/opt/aiadminpanel/backups/
{service-name}/
backup-2026-03-29-020000.tar.gz
backup-2026-03-22-020000.tar.gz

S3-Compatible Storage

Configure remote storage for off-server backups:

  1. Navigate to Settings > Backup > Storage
  2. Select S3-Compatible
  3. Fill in:
FieldDescription
EndpointS3 endpoint URL (e.g., https://s3.amazonaws.com or MinIO URL)
BucketBucket name
RegionAWS region (e.g., us-east-1)
Access KeyS3 access key ID
Secret KeyS3 secret access key
Path PrefixOptional prefix for backup objects (e.g., backups/)

Compatible with AWS S3, MinIO, Backblaze B2, Cloudflare R2, and any S3-compatible provider.

Restoring from Backup

To restore a service from a backup:

  1. Navigate to the service detail page
  2. Click Actions > Restore
  3. Select the backup to restore from
  4. Confirm the restore operation

The restore process:

  1. Stops the service
  2. Replaces volume contents with the backup data
  3. Restores database from the native dump (if applicable)
  4. Restarts the service
  5. Verifies the health check passes

Warning: Restoring overwrites current service data. The panel creates an automatic backup of the current state before restoring, in case you need to undo the restore.

Backup Management

Viewing Backups

Navigate to Settings > Backup to see all backups across services, or view per-service backups in the service detail page.

Each backup entry shows:

FieldDescription
ServiceWhich service was backed up
SizeCompressed backup size
DurationHow long the backup took
CreatedWhen the backup was created
StatusSuccess / Failed / In Progress
StorageLocal / S3

Retention Policy

Configure how many backups to retain:

  • Count-based: Keep the last N backups per service (default: 7)
  • Time-based: Keep backups for N days (e.g., 30 days)
  • Combination: Keep the last 7 daily + last 4 weekly

Old backups are automatically deleted when new backups are created.

Manual Deletion

Individual backups can be deleted from the backup list. Deletion removes both the backup metadata and the stored archive.

Infrastructure Backup

In addition to service backups, ensure you back up the panel's own infrastructure:

# Backup panel database
docker exec aiadminpanel_postgresql pg_dump -U aiadminpanel -d aiadminpanel > panel-backup.sql

# Backup Keycloak database
docker exec aiadminpanel_postgresql pg_dump -U aiadminpanel -d keycloak > keycloak-backup.sql

# Backup secrets
cp -r /opt/aiadminpanel/.env /opt/aiadminpanel/backup-env

Set up a cron job for automated infrastructure backups as these are not managed by the panel's backup system.