TechBuzzPro

Backup & Restore Proxmox LXC Containers Safely

· 6 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Backing up and restoring Proxmox LXC containers is essential for protecting your virtual environments from data loss, corruption, or accidental misconfiguration. This guide walks you through the entire process—from creating reliable backups to restoring them when something goes wrong—using both the web interface and the command line. You'll learn how to schedule automated backups, verify their integrity, and restore a container to a working state without downtime or data loss.

What You'll Need

  • A running Proxmox VE server (version 6.x or newer recommended)
  • Access to the Proxmox web interface (HTTPS) or SSH access to the host
  • A storage location with enough free space for your backups (local, NFS, SMB, or a dedicated backup storage)
  • Basic familiarity with Linux command line (for CLI steps)
  • Root or sudo privileges on the Proxmox host

Step-by-Step

Creating a Manual Backup via Web Interface

  1. Log in to the Proxmox web interface using your administrator credentials.
  2. In the left sidebar, select the node (host) where your container resides, then click on the container (CT) ID you want to back up.
  3. Navigate to the Backup tab within the container's menu.
  4. Click the Backup Now button at the top of the Backup tab.
  5. In the dialog that appears, choose the storage destination from the Storage dropdown (e.g., local or a dedicated backup storage).
  6. Select the Mode: Snapshot (recommended for running containers) or Stop (ensures consistency but causes downtime).
  7. Optionally, set a Compression method (e.g., ZSTD or Gzip) and a Notes field for identification.
  8. Click Backup to start the process. Wait for the task to complete; you'll see a success message in the task log.

Creating a Manual Backup via Command Line

  1. SSH into your Proxmox host as root or a user with sudo privileges.
  2. List your containers to confirm the CT ID: pct list
  3. Run the backup command with the desired storage and options, for example:
    vzdump 100 --storage local --mode snapshot --compress zstd
  4. Monitor the output; when it completes, the backup file will be stored in the specified storage's dump directory (e.g., /var/lib/vz/dump/ for local storage).

Scheduling Automated Backups

  1. In the Proxmox web interface, select the node (host) in the left sidebar.
  2. Click on Backup in the node's menu (not the container's).
  3. Click Add to create a new backup job.
  4. Fill in the schedule: choose the Storage, Selection mode (e.g., include all containers or specific IDs), and set the Schedule using cron syntax (e.g., 0 2 * * * for daily at 2 AM).
  5. Choose the Mode (Snapshot recommended) and Compression.
  6. Set Retention options to keep only a certain number of backups (e.g., keep 7 daily, 4 weekly).
  7. Click Create to save the job. It will run automatically as scheduled.

Restoring a Container from Backup

  1. In the Proxmox web interface, select the node (host) in the left sidebar.
  2. Navigate to the Backup tab under the node (not the container).
  3. You'll see a list of backup files. Find the one for your container (e.g., vzdump-lxc-100-2025_01_15-02_00_00.tar.zst).
  4. Select the backup file and click Restore.
  5. In the restore dialog, choose the target Storage for the container's rootfs.
  6. Specify a new CT ID if you want to keep the original, or use the same ID if the original is deleted (make sure no conflict exists).
  7. Optionally, set a new Hostname and adjust resource settings (CPU, RAM, disk) as needed.
  8. Click Restore to start. Once completed, the container will appear in the list; start it manually if it didn't auto-start.

Restoring via Command Line

  1. SSH into the Proxmox host.
  2. List available backups: ls -l /var/lib/vz/dump/ (or the path of your backup storage).
  3. Run the restore command, for example:
    pct restore 200 /var/lib/vz/dump/vzdump-lxc-100-2025_01_15-02_00_00.tar.zst --storage local-lvm
  4. After restore, start the container: pct start 200

Common Mistakes

  • Not using snapshot mode – Stopping the container for backup causes downtime; snapshot mode avoids it and is safe for most workloads.
  • Ignoring storage space – Backups can be large; always check free space on the target storage before starting.
  • Restoring to the same CT ID while the original still exists – This causes a conflict; either delete the original or use a different ID.
  • Skipping verification – A backup file that can't be restored is useless; test restores periodically.
  • Not setting retention – Without retention, backups pile up and fill storage, leading to failed backups.

Tips

  • Use the Snapshot mode for running containers to avoid downtime; it uses LVM or ZFS snapshots which are fast and consistent.
  • Store backups on a separate storage location (e.g., NFS or SMB) to protect against host disk failure.
  • Enable compression (ZSTD is fast and effective) to save space and speed up transfer.
  • Schedule backups during off-peak hours to minimize impact on performance.
  • Test a restore in a test environment (e.g., restore with a different CT ID) before relying on backups in a disaster.
  • Use the Proxmox Backup Server (PBS) if you need advanced features like deduplication and incremental backups.

Troubleshooting

Backup fails with "no space left on device" – Free up space on the target storage or reduce the number of retained backups.

Restore fails due to CT ID conflict – Delete the existing container or choose a different CT ID during restore.

Container doesn't start after restore – Check the container's configuration file for errors, verify that the rootfs storage exists, and review logs in /var/log/pve/tasks/ for the restore task.

Backup takes too long – Consider using a faster storage (e.g., local NVMe vs. network), or switch to a more efficient compression method like ZSTD.

Backup file is corrupt – If the backup file is corrupted, try an older backup. To prevent this, regularly test restores and ensure the storage is healthy.

Frequently Asked Questions

Can I back up a running container without stopping it?

Yes, use the Snapshot mode in vzdump. It creates a consistent snapshot of the container's filesystem without downtime, though it may briefly pause I/O.

Where are backup files stored by default?

By default, backups go to the local storage under the dump directory, typically /var/lib/vz/dump/. You can change the storage when creating a backup.

How do I restore a backup to a different Proxmox node?

You can copy the backup file to the target node's storage (e.g., via SCP or a shared NFS) and then restore it using the web interface or pct restore command on that node.

What is the difference between vzdump and pct backup?

vzdump is the Proxmox backup tool that works for both containers and VMs. pct is the container management command; there is no pct backup command—backups are done with vzdump.

Can I restore a container to a different CT ID?

Yes, during restore you can specify a new CT ID. This is useful for testing or when the original ID is already in use.

How long should I keep backups?

It depends on your needs, but a common strategy is to keep daily backups for 7 days, weekly for 4 weeks, and monthly for 6 months. Use the retention settings in the backup job to automate this.