Backup and restore under Debian 13 with Proxmox Backup Client

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

This article describes how to back up a Debian 13 system with the help of Proxmox Backup Clients on a Proxmox Backup server.

Initial situation

For the performance, a Proxmox Backup Server and a Debian 13 system, that you want to back up, is required.

If you did not install a PBS yet, you will find the instructions for the installation here: Proxmox Backup Server Installation.

Proxmox Backup Client

In this paragraph, the Proxmox Backup Client is installed and configured on a Debian 13 system.

The whole installation is performed as root user. With the following command, you can log in as root-user:

su

Add repository

First, the repository must be configured for the Proxmox Backup Client. For this, the proxmox-backup-client.list file must be created with the following command:

sudo nano /etc/apt/sources.list.d/proxmox-backup-client.list

The following content must be added to this file:

deb http://download.proxmox.com/debian/pbs-client trixie main

Next, the Repository-GPG-Key must be imported. Proxmox uses for every Debian version another GPG-key. For Debian version 13, the GPG-key for Trixie is required:

wget -qO - https://enterprise.proxmox.com/debian/proxmox-release-trixie.gpg | sudo tee /etc/apt/trusted.gpg.d/proxmox-release-trixie.gpg >/dev/null

Installation

After installing the Proxmox Backup Client repository, all package lists must be updated:

sudo apt update

Now, you can install Proxmox Backup Client:

sudo apt install proxmox-backup-client

Connect to PBS

After successful installation of the client, you can connect to the Proxmox Backup server with the following command:

proxmox-backup-client login --repository <user>@<pam>@<ipadresse>:<datastore>

The following adjustments must be made:

  • <user>: Enter the PBS username; we recommend using an alternative account with the necessary permissions rather than the root account
  • <pam>: Enter the realm required when logging in to PBS here (usually this is pam)
  • <ipaddress>: Enter the IP address of the Proxmox Backup server here
  • <datastore>: Specify the name of the datastore where the backups should be stored
  • The entry could look like this: "backup@pam@10.26.33.11:zfs-pool".

Accept the fingerprint and enter the password in the PBS.

Now, the Backup Client is installed on your Debian system.

Perform backup

Type of security

To back up a file or a path, run the following command:

proxmox-backup-client backup etc.pxar:/(directory or file that should be secured) --repository <user>@<pam>@<ipadresse>:<datastore>

If you want to back up the whole system, you require this command:

proxmox-backup-client backup etc.pxar:/ --repository <user>@<pam>@<ipadresse>:<datastore>

After you have performed one of these commands, the backup should now be displayed in the datastore of the Proxmox Backup server.

Display in the shell

You can display the backups in the Debian shell:

proxmox-backup-client snapshots --repository <user>@<pam>@<ipadresse>:<datastore>

Sample output:

┌──────────────────────────────────┬───────┬───────────────────────────────────┐
│ snapshot                         │  size │ files                             │
╞══════════════════════════════════╪═══════╪═══════════════════════════════════╡
│ host/debian/2026-03-11T11:33:16Z │ 728 B │ catalog.pcat1 etc.pxar index.json │
└──────────────────────────────────┴───────┴───────────────────────────────────┘

Restore

For the recreation of your data, perform the following command:

proxmox-backup-client restore <Backup Name> etc.pxar <destination directory> --repository <user>@<pam>@<ipaddress>:<datastore>
  • <Backup Name>: Enter the complete name of the backup
  • <Destination Directory>: Enter the destination directory for the restore here
  • <user>, <pam>, <ipaddress>, <datastore>: These should be selected as specified for connection to PBS

Example

The following values are used for the example:

  • Backup name: host/debian/2026-03-11T11:33:16Z
  • Destination directory: /home
  • user: backup
  • pam: pam
  • ip-address: 10.21.0.50
  • datastore: backup_ssd

This results in the following command:

proxmox-backup-client restore host/debian/2026-03-11T11:33:16Z etc.pxar /home --repository backup@pam@10.21.0.50:backup_ssd

Cron job

You can also automate your backups using a cron job.

Create script

First, you have to create the file /usr/local/sbin/debian-backup.sh:

nano /usr/local/sbin/debian-backup.sh

Create the following script (select the values enclosed in <> according to your settings):

#!/bin/bash
set -euo pipefail

export PBS_REPOSITORY="<user>@<pam>@<IPaddress>:<Datastore>"
export PBS_PASSWORD="<Password>"

proxmox-backup-client backup \
	home.pxar:/<directory>

Then make the script executable:

chmod +x debian-backup.sh

Installation and configuration of Cron

Next, Cron must be installed with the following commands:

sudo apt update

sudo apt install cron

Create Cron file:

sudo crontab -e

If you want to back up your data every day at 3:30 a.m., add the following text to the file:

30 3 * * * /usr/local/sbin/debian-backup.sh

The exact instructions for creating or changing Cron jobs can be found in the article https://wiki.ubuntuusers.de/Cron/ .


Author: Paul Streifinger

Paul Streifinger works as an apprentice in the Product Management Team at Thomas-Krenn. He earned his secondary school diploma at Freyung Secondary School and is completing his apprenticeship as an IT specialist for system integration at Thomas-Krenn AG. During his apprenticeship, he works with Proxmox VE (including Ceph and backup) and VMware.


Translator: Alina Ranzinger

Alina has been working at Thomas-Krenn.AG since 2024. After her training as multilingual business assistant, she got her job as assistant of the Product Management and is responsible for the translation of texts and for the organisation of the department.