Backup and Restore
Curated reference of vzdump, qmrestore and pct restore commands for Proxmox backup workflows. Includes scheduling, advanced options like hook scripts / exclude paths / I/O priority, and backup file management.
Three backup modes
For VMs, snapshot is a live backup and does not require storage snapshots. suspend pauses the VM before the live backup and does not necessarily improve consistency. stop shuts the VM down first; a previously running VM can resume once backup has started. LXC differs: snapshot mode requires snapshot-capable storage, suspend uses two rsync passes, and stop keeps the container stopped during backup.
VM Backup
| Command | Description | Action |
|---|---|---|
| vzdump <vmid> | Create a backup of a specific VM/CT | |
| vzdump <vmid> --storage <storage> | Backup VM to specific storage | |
| vzdump <vmid> --mode snapshot | Create snapshot backup (for VMs) | |
| vzdump <vmid> --mode suspend | Pause VM before the live backup (legacy suspend mode) | |
| vzdump <vmid> --mode stop | Shut down VM before starting the backup | |
| vzdump --all | Backup all VMs and containers | |
| vzdump --all --exclude <vmid1>,<vmid2> | Backup all except specified VMs |
Backup Options
| Command | Description | Action |
|---|---|---|
| vzdump <vmid> --compress zstd | Use zstd compression for backup | |
| vzdump <vmid> --compress gzip --pigz <threads> | Use pigz with multiple threads | |
| vzdump <vmid> --storage <storage> --notes-template <text> | Add notes to backup | |
| vzdump <vmid> --mailto <email> | Send notification email | |
| vzdump <vmid> --prune-backups keep-last=<n> | Keep only n backups per VM | |
| vzdump <vmid> --stdexcludes 0 | Don't exclude temporary files | |
| vzdump <vmid> --quiet 1 | Suppress output messages |
Restore Backups
| Command | Description | Action |
|---|---|---|
| qmrestore <backup-file> <vmid> | Restore VM from backup | |
| qmrestore <backup-file> <vmid> --storage <storage> | Restore to specific storage | |
| qmrestore <backup-file> <vmid> --unique | Restore VM with newly generated random MAC addresses | |
| pct restore <vmid> <backup-file> | Restore container from backup | |
| pct restore <vmid> <backup-file> --storage <storage> | Restore container to specific storage | |
| pct restore <vmid> <backup-file> --rootfs <storage>:<size-GiB> | Restore with a root disk allocated on the chosen storage and size | |
| pct restore <vmid> <backup-file> --unprivileged 1 | Restore as unprivileged CT |
Backup Management
| Command | Description | Action |
|---|---|---|
| ls -la /var/lib/vz/dump/ | List backups in default location | |
| find /var/lib/vz/dump/ -name "*.vma*" | Find VM backups | |
| find /var/lib/vz/dump/ -name "*.tar*" | Find container backups | |
| pvesm list <storage> --content backup | List backups in specific storage | |
| rm /var/lib/vz/dump/<backup-file> | Delete a backup file | |
| cat /etc/vzdump.conf | Show backup configuration |
Scheduled Backups
| Command | Description | Action |
|---|---|---|
| cat /etc/pve/jobs.cfg | Show backup schedule | |
| nano /etc/vzdump.conf | Edit backup configuration | |
| systemctl list-timers | List systemd timers | |
| systemctl status cron | Check cron service status | |
| pvenode task list --typefilter vzdump | List completed backup tasks | |
| pvenode task log <upid> | Show the log for a backup task UPID |
Advanced Operations
| Command | Description | Action |
|---|---|---|
| qmrestore <backup> <vmid> --force | Force restore, overwriting existing VM | |
| vzdump <vmid> --dumpdir <directory> | Specify custom backup directory | |
| vzdump <vmid> --script <script> | Run hook script during backup | |
| vzdump <vmid> --exclude-path <path> | Exclude specific paths from backup | |
| vzdump <vmid> --ionice <priority> | Set I/O priority for backup process | |
| vzdump <vmid> --lockwait <minutes> | Wait for lock | |
| qm importdisk <vmid> <disk-image> <storage> | Import a disk image file (for example raw, qcow2 or vmdk) as an unused disk, not a vzdump backup archive |
Test your restores
Periodically restore a backup to an unused test VMID with
qmrestore --unique, start the VM on an isolated test network and check its contents. The unique option generates new MAC addresses; it does not change static IPs or application settings. Test container restores with pct restore in the same way.Related
- VM and CT Management — qm and pct lifecycle commands.
- Storage and Disks — pvesm storage management.
- Help and Info overview.