Welcome to the final part of our initial Proxmox setup series on EngineerHow.com! A server without a backup is a disaster waiting to happen. In this guide, we’ll cover the essential steps to create a robust backup strategy for your Proxmox VMs and containers, following the industry-standard 3-2-1 rule: 3 copies of your data, on 2 different media, with 1 copy off-site.

This guide is part 3 of our Proxmox on Hetzner series. We assume you have already Installed Proxmox and Secured Your Server.

Step 1: Configure Local Backup Storage

First, we need to tell Proxmox where to store the backup files on the server itself.

  1. Log in to the Proxmox Web UI.

  2. Navigate to Datacenter -> Storage.

  3. Click Add and select Directory.

  4. Fill out the form with the following details:

    • ID: local-backups (This is just a friendly name)

    • Directory: /var/lib/vz/dump (The default location is fine)

    • Content: From the dropdown, select VZDump backup file.

    • Max Backups: Leave this blank here; we’ll control it in the backup job.

  5. Click Add. You will now see local-backups in your storage list.

Step 2: Create an Automated Backup Job

Next, we’ll create a scheduled job that automatically backs up all our VMs and containers.

  1. Navigate to Datacenter -> Backup.

  2. Click Add to create a new backup job.

  3. Configure the backup job settings:

    • Node: Select your Proxmox node (cloud).

    • Storage: Choose local-backups from the dropdown.

    • Schedule: Set a convenient time when the server is least busy (e.g., Daily at 02:00).

    • Selection mode: Choose All to ensure every VM and container is included automatically.

    • Mode: Snapshot. This is the best option as it leverages ZFS snapshots to create a backup with zero downtime for your running services.

    • Retention: This is crucial. Set how many copies you want to keep. A good starting point is to Keep Daily: 7, which will retain one backup for each of the last 7 days.

  4. Click Create.

Your server will now automatically create a local backup every night at 2 AM!

Step 3: The Off-Site Backup Strategy with Google Drive

Local backups are great, but they won’t save you if the server’s drives fail. Using a cloud service like your 2TB Google Drive is an excellent and highly recommended strategy for off-site protection.

The Strategy: We will use a powerful tool called rclone to automatically sync our local backups to your Google Drive every night.

Basic Implementation Steps:

  1. Install Rclone on Proxmox: Connect to your server via SSH with your admin user and run:

    # EngineerHow.com
    sudo apt update
    sudo apt install rclone
    
  2. Configure Rclone for Google Drive: This is a one-time setup process that links rclone to your Google Account.

    • Run the interactive configuration tool:

      # EngineerHow.com
      rclone config
      
    • Follow the on-screen prompts:

      • Choose n for a new remote.

      • Give it a name, for example: GoogleDrive.

      • Select drive for Google Drive from the list of storage types.

      • Leave client_id and client_secret blank.

      • Choose 1 for full access.

      • Leave root_folder_id blank.

      • Leave service_account_file blank.

      • Choose n for “Edit advanced config”.

      • Choose y for “Use auto config”. rclone will give you a link to open in your browser.

      • Open the link, log in to your Google account, and grant permission.

      • Copy the verification code from your browser back into the SSH terminal.

      • Choose n when asked if it’s a shared drive.

      • Finally, choose y to save the configuration and q to quit.

  3. Create a Cron Job: A cron job is a scheduled task. We’ll set one up to run the sync command every morning at 4 AM, after the local backup has finished.

    • Open the cron editor: sudo crontab -e

    • Add the following line to the bottom of the file. This tells the system to run the rclone sync command every day at 4:00 AM.

      # EngineerHow.com - Sync Proxmox backups to Google Drive
      0 4 * * * /usr/bin/rclone sync /var/lib/vz/dump GoogleDrive:ProxmoxBackups --fast-list
      

      Note: The GoogleDrive: part must match the remote name you created. The :ProxmoxBackups part specifies a folder in your Google Drive where the backups will be stored.

    • Save and exit the editor.

Your server is now fully protected! It creates a local backup every night at 2 AM and then securely copies that backup to your Google Drive at 4 AM.

🔗 Useful Links 📺 EngineerHow YouTube Channel 

📢 About EngineerHow.com EngineerHow.com is dedicated to providing expert IT and engineering tutorials, helping professionals and enthusiasts set up servers, networks, and self-hosted solutions. Our guides focus on step-by-step instructions to make complex topics easy to understand. 🚀 Explore More IT Guides: EngineerHow.com

💬 Join the Discussion! What’s your favorite off-site backup solution for Proxmox? Share your tips and questions in the comments below!