Skip to main content

Proxmox Backup Server: A Game Changer for HomeLabs!

In this video, I’ll guide you through setting up Proxmox Backup Server (PBS) to revolutionize your Proxmox backups. We’ll explore how to achieve incremental backups, deduplication, and efficient restores, moving beyond basic NFS shares. Discover how to install and configure PBS for both local and remote storage, ensuring your data is protected intelligently.

References
#

Notes
#

Why Proxmox Backup Server (PBS)?
#

PBS is a game-changer for Proxmox users, offering significant advantages over traditional backup methods like simple NFS shares. It enables:

  • Incremental Backups: Only store changes after an initial full backup, saving significant disk space.
  • Deduplication: Avoids storing identical data blocks multiple times, further optimizing storage.
  • Easy File Recovery: Beyond full VM restores, PBS allows file-level recovery.
  • Flexible Installation: Can run on a separate device, as a VM (with caution), or preferably as an LXC container on your Proxmox host.

Installing Proxmox Backup Server
#

While Proxmox recommends installing PBS on a separate physical device, it can be run as an LXC container on your existing Proxmox host to save on cost and power consumption.

Check out Proxmox Helper Scripts: https://community-scripts.github.io/ProxmoxVE/ to simplify the installation process.

Configuring Datastores
#

PBS supports storing backups locally or on remote storage.

Option 1: Local Storage (Example with LXC)
#

To use existing disks on your Proxmox host (e.g., ZFS, NVMe) for local storage within an LXC container:

  1. Stop the LXC Container.
  2. On Proxmox PVE, select the LXC Container and go to “Resources → Add: Mount Point”.
    • Select an available disk and specify a path inside the container (e.g., /mnt/backup-local).
    • Crucially, disable “Backup” for this mount point to prevent recursive backups.
  3. Inside the PBS LXC interface, navigate to “Datastore → Create: Datastore”.
    • Set the “Backing Path” to match the mount point you created (e.g., /mnt/backup-local).
    • GC Schedule (Garbage Collection): Configures when unused data blocks are removed.
    • Prune Schedule: Defines retention policies for your backups.
      • For a small HomeLab, a good starting point is keep daily: 7, keep weekly: 1, keep monthly: 1.
  4. Recommended Settings: In “Settings → Options,” enable “Verify new Snapshots” and configure notification settings if desired.

Adding Backup Jobs on Proxmox
#

To integrate your Proxmox hosts with your new Proxmox Backup Server:

Configure the PBS Datastore on Proxmox PVE
#

  1. On your Proxmox Backup Server, create a new backup user under “Configuration → Access Control → User Management.”
  2. Assign permissions to this user in “Configuration → Access Control → Permissions.”
    • Set the Path to /datastore, select your user, and add the Role DatastoreAdmin.
  3. On your Proxmox PVE host, go to “Datacenter → Storage” and add a new “Proxmox Backup Server” location.
    • server: Enter the IP address or hostname of your PBS.
    • datastore: Enter the name of the datastore you created on PBS.
    • fingerprint: Find this in your Proxmox Backup Server under “Configuration → Certificates → proxy.pem.”
    • Do not configure Backup Retention here; it is managed on PBS.
    • (Optional) Set up encryption.

Change Your Backup Target
#

  • Under “Datacenter → Backup” on your Proxmox PVE host, create a new backup job or modify an existing one to use your newly configured Proxmox Backup Server storage.

Restoring Backups
#

PBS enhances restore capabilities beyond typical VM restoration:

  • VM Restore: Standard full VM restore is available, similar to other storage types.
  • File-Level Restore: You can browse the contents of a backup and restore individual files directly from your Proxmox PVE node.
    • To do this, select the vm-backups storage on your Proxmox node, choose the desired backup, and select “File Restore.”
    • Files are typically downloaded as a “ZIP” archive, rather than an “in-place” restore directly to the VM.

Configuring Remote Storage (NFS Example for LXC)
#

Using remote storage like a NAS (e.g., TrueNAS, Unraid) centralizes data. If running PBS in an LXC, this requires a privileged container and careful configuration:

  1. SSH into your PBS LXC container.
  2. Create the necessary directories and set permissions:
    mkdir /mnt/vm-nfs-backup
    chown backup:backup /mnt/vm-nfs-backup
    chmod 775 /mnt/vm-nfs-backup
    
  3. Install nfs-common if it’s not already present:
    apt list --installed | grep nfs-common
    sudo apt install nfs-common vim
    
  4. Add an entry to /etc/fstab for persistent mounting (replace 10.20.0.7 with your NFS server IP and /vm-nfs-backup with your NFS export path):
    echo "10.20.0.7:/vm-nfs-backup /mnt/vm-nfs-backup nfs vers=4,nouser,atime,auto,retrans=2,rw,dev,exec 0 0" >> /etc/fstab
    
  5. Reload systemd daemon to recognize the new fstab entry:
    systemctl daemon-reload
    
  6. Verify the mount: ls /mnt/vm-nfs-backup/ (or similar).

Common Problems Encountered:

  • Directory Not Empty: Ensure the mount point directory (/mnt/vm-nfs-backup) is empty before attempting to mount the NFS share.
  • no_root_squash: On your NFS server, you might need to add the no_root_squash option to the NFS export settings. This allows the root user on the client (your PBS LXC) to have root privileges on the mounted directory, which is often necessary for PBS operations.
Christian Lempa
Author
Christian Lempa
IT & Tech Nerd | DevOps and Automation FanBoy