Backing up the panel
Daily backups of VaultPanel itself, with its database, secret key and certificate, and how to restore one on the same or a new server.
Websites, apps and databases have their own backups. This page is about the backup of VaultPanel itself: without it, losing the server means losing every account and setting, and the key that decrypts them.
What a backup holds
Each backup is one file in /var/backups/vaultpanel-panel (root only, mode 600) with a .sha256 checksum next to it. It holds:
- the panel's database, as a
mariadb-dump, .env, includingVAULTPANEL_SECRET_KEY, which decrypts two-factor secrets, the agent signing key and every stored password,- the HTTPS certificate and key, so agents on other servers keep trusting a restored panel,
- terminal recordings and the panel domain list,
- a
VERSIONfile with when, where and from which version it was made.
When backups are made
| Trigger | Label | Kept |
|---|---|---|
Every day, by vaultpanel-backup.timer | scheduled | VAULTPANEL_BACKUP_KEEP (14 by default) |
sudo vaultpanel backup | manual | all, unless you pass --keep |
| Before every update | pre-update | the last 3 |
| Before every restore | before-restore | the last 3 |
Files are named after the time and label, such as vaultpanel-20261020-031500-scheduled.tar.gz.
Make a backup now
sudo vaultpanel backup| Option | What it does |
|---|---|
--dir <folder> | Write the backup to another folder. |
--keep <n> | Keep only the newest n backups with this label. |
--label <name> | Label the backup (a-z, 0-9 and -, at most 32 characters). |
The backup needs the panel's MariaDB container that the installer set up. If you run the panel on your own database, back that database up yourself.
Settings
Set these in /opt/vaultpanel/.env. The next backup uses them; no restart is needed.
| Setting | Default | What it does |
|---|---|---|
VAULTPANEL_BACKUP_DIR | /var/backups/vaultpanel-panel | Where backups go. |
VAULTPANEL_BACKUP_KEEP | 14 | Daily backups kept. |
VAULTPANEL_BACKUP_PASSPHRASE_FILE | A file holding a passphrase. Backups are then encrypted (AES-256, PBKDF2) as .tar.gz.enc. | |
VAULTPANEL_BACKUP_UPLOAD | A command run after each backup with the file as $1, to copy it off the server. |
For example, to copy every backup to another machine:
VAULTPANEL_BACKUP_UPLOAD=rclone copy "$1" remote:vaultpanelIf the upload command fails, the backup is still made and the command prints a warning.
Restore a backup
On the same server, or on a new one installed with the installer:
sudo vaultpanel restore /var/backups/vaultpanel-panel/vaultpanel-20261020-031500-scheduled.tar.gzThe restore:
- checks the file against its
.sha256checksum, when there is one, - decrypts an
.encbackup withVAULTPANEL_BACKUP_PASSPHRASE_FILE, or asks for the passphrase, - asks you to type
restore(--yesskips the question), - takes a safety backup of the current panel,
- puts back the database, the settings and secret key, the certificate and the panel's files,
- updates the database to the installed version and restarts the panel.
The server keeps its own database and Redis passwords, ports and folders, so a backup from an old server restores onto a new one.
After restoring on a new server:
- If the new server has another address, run
sudo vaultpanel url <address>, andsudo vaultpanel https renewso the certificate names it. - A backup from a newer VaultPanel needs that version first:
sudo vaultpanel update --version <it>, then restore again.