Skip to main content

Resource Backups

Manage backup schedules for applications, services, and databases. Resource backups capture volumes, configuration, or complete snapshots on a cron schedule, with optional upload to S3 storage.

note

This is separate from database-native backups (pg_dump, mysqldump). Resource backups capture Docker volumes and container configuration at the infrastructure level.

List Backup Schedules​

GET /api/v1/resource-backups
ParameterTypeDescription
resource_typestringFilter: application, service, or database
resource_idintegerFilter by resource ID

Response:

{
"data": [
{
"id": 1,
"resource_type": "App\\Models\\Application",
"resource_id": 42,
"backup_type": "full",
"frequency": "0 2 * * *",
"s3_storage_id": 1,
"enabled": true,
"keep_locally": true,
"number_of_backups_locally": 5,
"created_at": "2024-06-01T08:00:00Z"
}
]
}

Create Backup Schedule​

POST /api/v1/resource-backups
{
"resource_type": "application",
"resource_id": 42,
"backup_type": "full",
"frequency": "0 2 * * *",
"s3_storage_id": 1,
"enabled": true,
"keep_locally": true,
"number_of_backups_locally": 5
}
ParameterTypeRequiredDescription
resource_typestringYesapplication, service, database, or coolify_instance
resource_idintegerYes*Resource ID (*not required for coolify_instance)
backup_typestringYesvolume, configuration, full, or coolify_instance
frequencystringYesCron expression (e.g., 0 2 * * * for daily at 2 AM)
s3_storage_idintegerNoS3 storage destination for remote upload
enabledbooleanNoEnable the schedule (default: true)
keep_locallybooleanNoKeep local backup copy (default: true)
number_of_backups_locallyintegerNoNumber of local backups to retain

Backup Types​

TypeWhat's Captured
volumeDocker persistent volumes attached to the resource
configurationEnvironment variables, Docker Compose files, resource settings
fullBoth volumes and configuration in a single archive
coolify_instanceFull Coolify instance backup (database, config, SSH keys)

Response: 201 Created

{
"message": "Resource backup schedule created.",
"data": {
"id": 1,
"resource_type": "App\\Models\\Application",
"resource_id": 42,
"backup_type": "full",
"frequency": "0 2 * * *",
"enabled": true
}
}

Get Backup Schedule​

Returns schedule details with recent execution history:

GET /api/v1/resource-backups/{id}

Response:

{
"id": 1,
"resource_type": "App\\Models\\Application",
"resource_id": 42,
"backup_type": "full",
"frequency": "0 2 * * *",
"enabled": true,
"executions": [
{
"id": 10,
"status": "success",
"filename": "backup-2024-06-15.tar.gz",
"size": 1048576,
"is_encrypted": true,
"created_at": "2024-06-15T02:00:00Z"
},
{
"id": 9,
"status": "success",
"filename": "backup-2024-06-14.tar.gz",
"size": 1024000,
"is_encrypted": true,
"created_at": "2024-06-14T02:00:00Z"
}
]
}

Update Backup Schedule​

PUT /api/v1/resource-backups/{id}
{
"frequency": "0 3 * * *",
"enabled": false,
"number_of_backups_locally": 10
}

Delete Backup Schedule​

DELETE /api/v1/resource-backups/{id}

Response:

{
"message": "Resource backup schedule deleted."
}
note

Deleting a schedule does not remove existing backup files. Previously created backups remain on disk and in S3 storage.

Execute Backup Now​

Trigger an immediate backup execution outside the cron schedule:

POST /api/v1/resource-backups/{id}/execute

Response:

{
"message": "Backup job dispatched."
}

The backup runs asynchronously. Check the schedule's executions to monitor progress.

Encryption​

When S3 storage has encryption enabled, backups are automatically encrypted using rclone's crypt backend (NaCl SecretBox). The is_encrypted field in execution records indicates whether encryption was applied.

Configure S3 encryption from the dashboard under Settings > S3 Storage > Encryption.