How do I back up my VPS and my containers?
Export databases and volumes from the VPS, copy the archives off the server and test the restore. The panel does not back up VPSs for the time being.
The panel does not back up VPSs for the time being: backups are prepared from the VPS itself. Export each database with its own tool, archive the rest and keep a copy off the server.
Step-by-step procedure
-
Identify the data
List Docker volumes, databases, configuration files, keys and user data.
-
Create consistent exports
Use the database’s dump tools and briefly stop the application if it does not support hot copies.
-
Schedule the exports
Run the exports every night with cron and keep several dated versions, as in the second command block. These exports, copied off the VPS, are your backup.
-
Copy out of VPS
Transfer exports to separate storage. A copy on the same disk does not protect against failure or deletion.
-
Test the restoration
Restore periodically in an isolated environment and note the procedure and duration.
Archive of a volume n8n
docker run --rm \
-v n8n_data:/data:ro \
-v /var/backups:/backup \
alpine tar -czf /backup/n8n-data.tar.gz -C /data .
Daily export of the n8n volume (crontab -e)
30 3 * * * docker run --rm -v n8n_data:/data:ro -v /var/backups:/backup alpine tar -czf /backup/n8n-$(date +\%F).tar.gz -C /data .
0 4 * * * find /var/backups -name 'n8n-*.tar.gz' -mtime +7 -delete
Fetch the archives to your computer
rsync -avz root@IP:/var/backups/ ./vps-backups/
What to export and how
A file archive taken while a database is writing may be unusable. Export each database with its own tool, then archive the rest.
- MariaDB or MySQL: mysqldump --single-transaction --all-databases > /var/backups/mysql.sql.
- PostgreSQL in a container: docker exec db pg_dumpall -U postgres > /var/backups/postgres.sql, where db is the container name.
- Configuration: /etc, the compose.yaml and .env files, the Caddyfile and the output of crontab -l.
- n8n: the n8n_data volume also holds the key that encrypts the stored credentials. Without it, restored credentials cannot be read.
Copy and keep the archives
Fetch the archives from your computer or another server with rsync or scp. A copy pulled from outside stays available even if the VPS is compromised, full or reinstalled.
Schedule the export with cron and keep several dated versions: a single copy overwritten every night also reproduces a mistake or a deleted file. To check an archive, list it with tar -tzf, then restore it into a test volume and start the application on it.
Frequently asked questions
Does the panel back up my VPS automatically?
Not at the moment. In “Additional tools”, the “Backups” and “Backup logs” entries are marked “Unavailable”. Set up your own exports and copy them off the VPS.
Why do I get tar: file changed as we read it?
A file was modified during archiving. Export the database with its dump tool first, or stop the container during the archive with docker compose stop, then start it again.
What should I do if No space left on device appears during the backup?
The disk is full. Check with df -h, find large folders with du -sh /var/backups/* and docker system df, then delete old archives that are already copied elsewhere.
Why does n8n show Credentials could not be decrypted after a restore?
The instance encryption key does not match the one used for the data. Restore the whole volume, including the config file, or set N8N_ENCRYPTION_KEY to the old key before starting n8n.