How to backup CloudPanel installed on a Synology NAS
To back up CloudPanel installed directly on a Synology NAS, you’re likely running it inside a Docker container, possibly using Synology’s Docker GUI. Here’s how to properly back up the CloudPanel instance and its associated data:
🔄 Backup CloudPanel on Synology NAS (Docker)
📁 Step 1: Identify What to Back Up
You need to back up:
- CloudPanel container volumes (websites, configs)
- Database container volumes (MariaDB/MySQL)
- Any custom
docker-compose.yml
or configuration files
To locate them:
Option A: Using Synology GUI
- Open Docker > Container > Select CloudPanel > Details
- Check the Volumes tab to find the mapped folders
- For example:
/volume1/docker/cloudpanel
- For example:
Option B: Using SSH
bashCopyEditdocker inspect <cloudpanel_container_name> | grep Mounts -A 20
🗃️ Step 2: Backup Strategy
🧠 Option 1: Use Hyper Backup (GUI method)
- Open Hyper Backup on Synology.
- Choose Local Folder & USB, Remote NAS, or Cloud Storage as destination.
- Select the Docker-mapped folders (e.g.,
/volume1/docker/cloudpanel
,/volume1/docker/mariadb
) - Schedule backups and enable rotation.
⚙️ Option 2: Manual rsync or cronjob (CLI method via SSH)
Create a backup script to compress the relevant folders.
bashCopyEdit#!/bin/bash
BACKUP_DIR="/volume1/backups/cloudpanel-$(date +%F)"
mkdir -p "$BACKUP_DIR"
# Backup CloudPanel data
rsync -a /volume1/docker/cloudpanel/ "$BACKUP_DIR/cloudpanel-data/"
rsync -a /volume1/docker/mariadb/ "$BACKUP_DIR/mariadb-data/"
# Optional: Backup Docker Compose file
cp /volume1/docker/docker-compose.yml "$BACKUP_DIR/"
# Compress it (optional)
tar -czf "$BACKUP_DIR.tar.gz" -C /volume1/backups "cloudpanel-$(date +%F)"
rm -rf "$BACKUP_DIR"
Then schedule it with crontab -e
:
bashCopyEdit0 2 * * * /volume1/docker/backup-cloudpanel.sh
💾 Step 3: Backup the Databases Properly (Optional but Recommended)
If using MariaDB in a container:
bashCopyEditdocker exec <mariadb_container_name> \
mysqldump -u root -p'yourpassword' --all-databases > /volume1/docker/backups/all-databases.sql
🔁 Step 4: Automate & Rotate
For long-term safety:
- Enable Hyper Backup rotation or manually delete old
.tar.gz
files. - Test restoring by spinning up a test container with the backed-up volumes.