# How to install Proxmox Backup Client

This guide explains how to install and use Proxmox Backup Client on a Debian VM. This would allow non proxmox machine to be backed up using PBS.

[Proxmox Backup Client Documentation](https://othersidetech.com/ProxmoxBackupServer/proxmox-backup-client/)

[Proxmox Installaton for Proxmox Backup Client Documentation](https://pbs.proxmox.com/docs/installation.html#install-proxmox-backup-client-on-debian)

#### Installing Proxmox Backup Client

1. Add the repository
2. In order to configure this repository you need to first setup the Proxmox release key

Please note that this installation is for Debian 12 (Bookworm). If you are on a newer version, use this guide a reference with the updated command on: https://pbs.proxmox.com/docs/installation.html#package-repositories-client-only-apt

```bash
sudo wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg
```

```bash
sudo nano /etc/apt/sources.list.d/pbs-client.list
```

3. add the line

```bash
deb http://download.proxmox.com/debian/pbs-client bookworm main
```

4. Install Proxmox Backup Client

```bash
sudo apt update
```

```bash
sudo apt install proxmox-backup-client
```

```bash
proxmox-backup-client version
```

#### Configure Proxmox Backup Client

##### First backup

```bash
sudo proxmox-backup-client backup "backupname".pxar:"directory" --repository "backupuser"@pbs@"PBS-IP":"DataStoreName" -ns "YourNameSpace"
```

Example:

```bash
sudo proxmox-backup-client backup mkdocsbackup.pxar:/home/user/docker --repository ardougneBackupUser@pbs@100.102.226.112:HDD-storage-5Tb -ns azure_mkdocs
```

##### List all backups

```bash
proxmox-backup-client list --repository "backupuser"@pbs@"PBS-IP":"DataStoreName" -ns "YourNameSpace"
```

example:

```bash
proxmox-backup-client list --repository ardougneBackupUser@pbs@100.102.236.112:HDD-storage-5Tb -ns azure_mkdocs
```

##### Backup encryption

```bash
proxmox-backup-client key create /home/user/encryption.key
```

Fill in your desired key

#### Storing credentials

This is so that you do not need to enter credentials for each backups.

- **Environment variables:** is an option, but credentials are stored in plain text.
- **Systemd credentials:** are stored as encrypted files that only systemd decrypts when launching a service. We will be using systmd credentials for this guide.

To store the password of the backup user:

```bash
sudo systemd-ask-password -n | systemd-creds encrypt --name=proxmox-backup-client.password - /your/password/directory/password.cred
```

To store the encryption key we created:

```bash
systemd-ask-password -n | sudo systemd-creds encrypt --name=proxmox-backup-client.encryption-password - /home/user/encryption-password.cred
```

Let's create a systemd service:

```bash
sudo nano /etc/systemd/system/backup.service
```

Paste in the following (fill in your own details and remove the quotes):

```bash
[Unit]
Description=Proxmox Backup Client service
Wants=network-online.target
After=network-online.target

[Service]
Type=oneshot
ExecStart=proxmox-backup-client backup "backupname".pxar:/home/user/docker \
  --repository "backupuser"@pbs@"PBS-IP":"DataStoreName" \
  -ns "YourNameSpace" \
  --keyfile /home/user/encryption.key
LoadCredentialEncrypted=proxmox-backup-client.password:/home/user/password.cred
LoadCredentialEncrypted=proxmox-backup-client.encryption-password:/home/user/encryption-password.cred

[Install]
WantedBy=multi-user.target
```

Reload systemd so it picks up the service

```bash
sudo systemctl daemon-reload
```

Test it:

```bash
sudo systemctl start backup.service
```


#### Schedule a backup

To start a backup at a certain time

```bash
sudo nano /etc/systemd/system/backup.timer
```

```
[Unit]
Description=Run backup daily at 2am

[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true

[Install]
WantedBy=timers.target
```

```bash
sudo systemctl daemon-reload
```

```bash
sudo systemctl enable --now mkdocs-backup.timer
```


#### Restore a backup

First list all your backups:

```bash
sudo proxmox-backup-client snapshot list "backupname".pxar:"directory" --repository "backupuser"@pbs@"PBS-IP":"DataStoreName" -ns "YourNameSpace"
```

To restore a backup:

```bash
proxmox-backup-client restore host/"YourHostname"/2025-08-09T15:51:02Z "backupname".pxar /where/to/restore --repository "backupuser"@pbs@"PBS-IP":"DataStoreName" -ns "YourNameSpace"
```