# Backups Setup

# Set Up Proxmox Backup Server with NFS Storage

Proxmox Backup Server PBS is design to backup Proxmox Virtual Environment. Proxmox Backup Server is designed to run bare-metal on dedicated hardware, with dedicated drives for the operating system and backups. The main backup should be on bare metal and NFS Storage as additional job for redundancy. This article assumes that PBS is already set up and functional, and using Synology.

Note:

- When you configure a datastore in Proxmox Backup Server, it creates one hidden folder (.chunks) and one hidden file (.lock). These files must be created by the backup user (UID:34 / GID:34).
- This is the ultimate problem with using shared storage – most users don’t have a user and group named backup with the UID/GID of 34. This is a problem, because you’ll immediately run into permission issues attempting to create the two folders above.
- To get around this, you can change the ownership (chown backup:backup \[mounted\_folder\]) to ensure the backup user and group own the folder….if your NAS allows it.

##### Setting up Shared Folder and Permissions on NAS

1. Login to **Synology DSM**
2. Open **Control Panel** and under **Shared Folder** click **Create**
    1. Add **IP** of PBS server
    2. Set Privilege to **Read/Write**
    3. Make sure Squash is set to **Map all users to admin** - in order for this to work

![Screenshot From 2025-11-30 18-18-02.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-11/scaled-1680-/screenshot-from-2025-11-30-18-18-02.png)

Make sure to add Firewall rule on Synology NAS to allow PBS IP to NFS application, as well as set Firewall rule on Unifi router to allow traffic from PBS to NAS.

##### Create Directory on PBS and connect to NAS via NFS

1. Log in to PBS and access shell or access PBS via ssh
2. Make two directories in the PBS shell – one will be mapped temporarily, and the other will be used for creating the datastore.

```bash
mkdir /mnt/pbs-backups
mkdir /mnt/temp
```

2. Change the ownership of the folder to the backup user and group. The system should do this automatically, but I like to do it regardless.

```bash
chown backup:backup /mnt/pbs-backups
```

3. **Add** the permissions on your NAS for NFS to the IP address of your PBS server. Steps Above
4. Update the **fstab** file so that the directory mounts automatically at boot to the NAS. This is done temporarily so that we can move the files from the local directory to the NAS.

```bash
nano /etc/fstab
```

5. **Add** the information below to the file to enable NFS connection, then **save** it

```bash
[IP_ADDRESS]:[LOCATION/FOLDER_ON_NAS] /mnt/temp nfs defaults 0 0
```

6. Mount the directory

```bash
mount -a
```

7. **Add** a **Datastore** in PBS. Select Add Datastore, then give it a name, and add the backing path below. Remember, this will temporarily write the data locally, which we’ll then move to the NAS.

```bash
/mnt/pbs-backups
```

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-11/scaled-1680-/image.png)

GC and Prune schedule can be set at later time. Or schedule them here

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-11/scaled-1680-/kuUimage.png)

8. Back on Shell. **Move** the **data** to the temp folder, which is technically mounted to the NAS. This might take a little while depending on your network speeds.

```bash
cp -R /mnt/pbs-backups/.chunks /mnt/pbs-backups/.lock /mnt/temp
```

9. Now that the data has been written to the NAS, we can mount the folder on the NAS to the pbs-backups directory.

```bash
[IP_ADDRESS]:[LOCATION/FOLDER_ON_NAS] /mnt/pbs-backups nfs defaults 0 0
```

10. Run the commands below to mount the directory to the new folder.

```bash
mount-a
systemctl daemon-reload
```

11. Reboot Proxmox Backup Server and see if the datastore is functional. You should be able to navigate the datastore, see the available storage, and create a prune schedule.

Connecting NFS storage from NAS to PBS is complete. Next step is to create [Backup Job with PBS on Proxmox Virtual Environment server.](https://docs.cyberpaw.org/books/proxmox-ve-pbs-setup-guide/page/schedule-backup-job-with-pbs)

# Schedule Backup Job with PBS

This guide goes over scheduling backup job with PBS server. Proxmox Virtual Environment can run it's own jobs, but for best optimization, using deducation and verify jobs, having PBS is good idea. Also, it provides redundancy if pve goes down.

Using Proxmox Backup Server (PBS) over Proxmox VE (PVE) native backups offers several significant advantages, particularly for environments requiring efficient, secure, and reliable backup management. The primary benefit is that PBS performs incremental backups, transferring only changed data since the last backup, which drastically reduces backup time and network bandwidth usage compared to PVE’s full backup approach that copies entire VM or container images each time. This incremental method, combined with advanced deduplication, ensures that duplicate data across multiple VMs or containers is stored only once, leading to substantial space savings and allowing for more frequent backups without excessive storage consumption.

#### Setting up Datastore in Proxmox Backup Server

1. Login to PBS
2. Under **Datastore** click **Create Datastore**
    1. Name: Choose name to call it
    2. Backup Path: Select the path to folder directory on the machine. If not using volume from machine check out this article to [use NAS storage via NFS](https://docs.cyberpaw.org/books/installation-guides-for-software-and-services/page/set-up-proxmox-backup-server-with-nfs-storage)
    3. Under Prune option this is personal preference, but deduplication really lowers the amount of space needed, so keeping more backups is not bad decision.
3. Once done click **Add**

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/G92image.png)

When the datastore is added, clicking on datastore will give you info, and also ability to adjust Prune and CG Jobs. Also, under Verify Jobs it's good idea to add Verify Job for checking that backup isn't corrupted and that will work when needed.

4. Under **Prune &amp; CG Jobs** make sure CG Job is set to daily. You can adjust Prune job here as well
5. Under **Verify Job** click **Add** and schedule Verify to run Daily and Re-Verify to run every 30 days

It is optional to create a namespace. Storing your backups in separate namespaces is very useful if you ever plan on planning to use your PBS to store backups from multiple Proxmox hosts, or even other Linux server.

5. Under **Content** click **Add Namespace**
    
    
    1. **Parent Namespace:** This would be folder in which this subfolder will live, usually root
    2. **Namespace Name:** name of the folder where backups will live

#### Adding PBS Database on PVE instance

1. Select Datacenter &gt; Storage &gt; Add &gt; Proxmox Backup Server
2. Set the parameters to match the information below: 
    1. ID: the name you’d like to use (I use pbs-backups)
    2. Server: IP address of Proxmox Backup Server
    3. Username: bservice@pbs (use user made specifically for pbs to pve connection).
    4. Password: Password of the user
    5. Datastore: Name of the datastore you created in PBS
    6. Namespace: if you have namespace add it here
    7. Fingerprint: hash from PBS server. Paste the fingerprint copied from the PBS dashboard
    8. **Add** Database

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/Fa0image.png)

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-11/scaled-1680-/6zCimage.png)

#### Add a Backup Job in PVE

1. Login back to Proxmox Virtual Environment
2. Select **Datacenter** then **Backup,** then select **Add**
    1. Under **General**
        1. Select PBS Storage
        2. Schedule put a time that works best
        3. Selection Mode: best to do All
        4. Mode: Stapshot is the most reliable for daily backup. Stop can be run once a week
    2. Retention 
        1. This is configured on PBS side
3. Click **OK** to schedule the backup

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/kdjimage.png)

# Backing up Proxmox Virtual Environment to Synology NAS

This article goes trough setting up NFS connection between Synology and PVE Database. Although using Proxmox Backup Server is better for keeping more backups using deduplication, verification and pruning options, having additional backup job directly from PVE instance can increase redundancy in case of PBS failure.

Having Proxmox Virtual Environment and Synology NAS up and running are pre requisite for this setup.

#### Setting up NFS connection on Synology

1. Open the **Control Panel** on Synology **DSM** and select **File Services** then **NFS**
2. Select **Enable NFS service** and then **Apply.** (NFSv3 is still a safe, but selecting latest protocol is always a good idea)

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/rG9image.png)

3. Select **Shared Folder** in Control Panel, then **Create** new or **Edit** the folder where you’d like your Proxmox data to be stored
4. Select **NFS Permissions**
    1. **IP:** put the IP address of Proxmox machine
    2. **Privilege:** Leave it Read/Write so pve can access backups when needed
    3. **Squash:** Set to No Mapping
    4. Select A**llow users to access mounted subfolders**
5. Click **Save**

![image.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/KdJimage.png)

Make sure Synology Firewall is configured to allow Proxmox IP address to access Synology via NFS. Also, on Unifi router settings ensure that there is a rule set to allow access.

#### Proxmox Storage Configuration

1. Login to Proxmox Virtual Environment
2. Select **Datacenter** then **Storage**
3. Select **Add** then **NFS**

![Screenshot from 2025-12-01 10-20-05.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/screenshot-from-2025-12-01-10-20-05.png)

4. At the **NFS** screen 
    1. Create an **ID**
    2. **IP** Address of your Synology NAS server
    3. In the **Export** drop-down menu, the location of your Proxmox folder should automatically appear (If not, there is problem with Synology Firewall or Router Firewall)
    4. In the Content drop-down, select **ALL** entries. You can then select **Add**

![Screenshot from 2025-12-01 10-22-05.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/screenshot-from-2025-12-01-10-22-05.png)

Proxmox should now show the Synology NAS Storage that we created above

#### Setting up Backup Job

We can now backup individual machines or create a backup job

1. Under Datacenter go to **Backups**
2. Select **Add** button
3. In Backup Job window under **General**
    1. Keep Node to All
    2. Storage: Select NFS storage we configured
    3. Schedule: Pick date that works best for you
    4. Selection Mode: Either select all or manually choose which VMs and LXCs to run backup for
    5. Mode: Snapshot for daily backup, Suspend or Stop for weekly (make sure that your applications are set to automatically start at reboot)

[![Screenshot from 2025-12-01 10-23-24.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/screenshot-from-2025-12-01-10-23-24.png)](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/screenshot-from-2025-12-01-10-23-24.png)

4. In Backup Job window under **Retention**
    1. Set retention that best works for you, depending on the storage size allocated

[![Screenshot from 2025-12-01 10-28-40.png](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/scaled-1680-/screenshot-from-2025-12-01-10-28-40.png)](https://docs.cyberpaw.org/uploads/images/gallery/2025-12/screenshot-from-2025-12-01-10-28-40.png)

# 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"
```