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
snapshot uses a live snapshot — guest stays running, briefly pauses I/O. suspend freezes the VM during backup (safer than snapshot for non-snapshot-aware FS). stop shuts down the VM, backs up cold, restarts. Pick by guest tolerance and storage capability.
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 | Suspend VM during backup | |
| vzdump <vmid> --mode stop | Stop VM during backup | |
| vzdump --all | Backup all VMs and containers | |
| vzdump --exclude <vmid1>,<vmid2> | Backup all except specified VMs |
Backup Options
| Command | Description | Action |
|---|---|---|
| vzdump <vmid> --compress zstd | Use zstd compression for backup | |
| vzdump <vmid> --pigz <threads> | Use pigz with multiple threads | |
| vzdump <vmid> --notes <text> | Add notes to backup | |
| vzdump <vmid> --mailto <email> | Send notification email | |
| vzdump <vmid> --maxfiles <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 | Create a VM with unique ID | |
| 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> | Restore to specific rootfs | |
| 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> | 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/cron.d/vzdump | Show backup schedule | |
| nano /etc/vzdump.conf | Edit backup configuration | |
| systemctl list-timers | List all scheduled tasks | |
| systemctl status cron | Check cron service status | |
| grep vzdump /var/log/syslog | Check backup logs in syslog | |
| tail -f /var/log/vzdump.log | Monitor backup log in real-time |
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> <backup> <storage> | Import disk from backup |
Test your restores
A backup you've never restored isn't a backup. Periodically pick a backup, restore it to a test VMID with
qmrestore --unique, boot the resulting VM and confirm the contents are intact. Same idea for containers via pct restore.Related
- VM and CT Management — qm and pct lifecycle commands.
- Storage and Disks — pvesm storage management.
- Help and Info overview.