Skip to content

Host Backup

This solution uses the proxmox-backup-client for creating the backup on an remote Proxmox Backup Server.


Create an user for the Backups on the PBS. This user requires the DatastoreBackup permission on the Namespace in your Datastore, ex. `/datastore/hdd01/demo.

Encryption Key

If you have no Key, from VM Backups, you can create a new one with proxmox-backup-client key create <Path to keyfile> --kdf none.

If you want to reuse an existing key you can find the key generatet over the GUI under /etc/pve/priv/storage/.

Example script


BACKUP_SERVER="<Backup server>"
BACKUP_DATASTORE="<Backup datastore>"
BACKUP_NAMESPACE="<Backup namespace>"
BACKUP_ENCRYPTION_KEY="<Path to encryption key>"

export PBS_PASSWORD_FILE="<Path to user password file>"

echo "Check if encryption Key exists"

if [ -f ${BACKUP_ENCRYPTION_KEY} ]; then
    echo "Encryption key found"
    echo "No encryption key found"
    echo "Create key with: proxmox-backup-client key create ${BACKUP_ENCRYPTION_KEY} --kdf none"
    exit 1

echo "Create Backup"
proxmox-backup-client backup \
    root.pxar:/ \
    --include-dev /etc/pve \
    --exclude /tmp \
    --ns ${BACKUP_NAMESPACE} \
    --keyfile ${BACKUP_ENCRYPTION_KEY}