Home Proxmox Backup Server Getting Started With Proxmox Backup Server

Getting Started With Proxmox Backup Server

Backup And Restore VMs And Containers Using Proxmox Backup Server

By sk
Published: Updated: 12.3K views

In this tutorial, we will learn how to get started with Proxmox Backup Server. First, we will be discussing about the Proxmox Backup Server's dashboard and then we will move on to learn how to backup and restore VMs and Containers using Proxmox Backup Server.

Install Proxmox Backup Server

We have published a detailed guide on installing Proxmox Backup Server (PBS). Check the following guide to learn how to install Proxmox backup Server.

As I mentioned in the PBS installation guide, we can either install PBS from an ISO or install PBS on a top of an existing Debian system. We have documented both methods in that guide. It is up to you to decide which method you follow.

Understanding Proxmox Backup Server Web Dashboard

Before backing up the VMs and Containers, it is important to get familiarize with PBS dashboard.

To open Proxmox Backup Server's Web UI, enter the URL - https://IP_Address:8007 in the address bar of the web browser from a system that has GUI installed.

You will see a security certification warning message for the first time. It is completely normal, because we haven't configured SSL yet. Simply click the "Accept the risk and continue" button.

Security Certificate Warning Message
Security Certificate Warning Message

You will now be asked to enter the user credentials. The user name is root and the password is whatever you typed during the PBS installation. You may need to open the port 8007 in firewall/router in case you're accessing the Proxmox web dashboard from other systems on the network.

Login to Proxmox Backup Server Web Dashboard
Login to Proxmox Backup Server Web Dashboard

Right after you logged into the PBS web UI, you will see the Proxmox subscription warning message. If you want to get support from Proxmox dev team, you should purchase a key. If you just want to use it in your homelab or you use PBS for testing purpose, you don't have to purchase the key. Simply ignore this message by clicking the OK button.

This is how Proxmox Backup Server's web user interface looks like.

Proxmox Backup Server Web User Interface
Proxmox Backup Server Web User Interface

As you can see, PBS dashboard has a few sections. Let us see brief description about each section.

Dashboard Section

The Dashboard tab includes some basic useful details about the PBS server. In this section, you will see the following metrics:

  • CPU usage,
  • RAM usage,
  • Hard disk and swap usage,
  • Processor type and the no. of cores,
  • Kernel version,
  • Status of the proxmox repositories,
  • Datastore usage,
  • Currently running tasks,
  • Task summary,
  • and the Proxmox subscription status.

Configuration Section

In the Configuration tab, you will see the Time zone, date and time, Domain name, DNS details, and the list of available Network Interfaces.

Configuration Section
Configuration Section

If you want to change the value for a setting, simply select it and click the Edit button. You can also create "Network bridge" and "Network bond" under Network Interfaces sub-tab

There are two other sub-tabs namely Metric Server and Other, which allows you to add PBS to external InfluxDB metric server and configure HTTP proxy etc.

The Configuration section is further divided into 5 more sub-sections namely Access Control, Remotes, Traffic Control, Certificates and Subscription.

Access Control

Under the Access Control sub-section, we can create and manager users, configure two-factor authentication, assign user permissions and a few more.

Access Control Section
Access Control Section

By default, root user is created during PBS installation. If you want to allow other users to manage the PBS, you can create additional users and assign permissions accordingly.

Remotes

A remote refers to a separate Proxmox Backup Server installation and a user on that installation, from which you can sync datastores to a local datastore with a Sync Job.

You can configure new remotes under Configuration -> Remotes or use the remote sub-command.

Remotes Section
Remotes Section

In order to add a new remote, you either need its IP address or hostname, username, password and its certificate fingerprint.

To find the fingerprint of a PBS, go to its Dashboard and click the "Show Fingerprint" button on the top.

Show Proxmox Backup Server Fingerprint
Show Proxmox Backup Server Fingerprint

Alternatively, you can run the following command to get the fingerprint from commandline:

# proxmox-backup-manager cert info |grep Fingerprint
Fingerprint (sha256): 88:35:ef:e4:82:c8:97:99:77:0:a1:d8:c0:c2:2b

Once you got the aforementioned details, click "Remotes -> Add" button and enter the required details.

Add New Remote
Add New Remote

if you prefer commandline, you can also use the following command to add a new remote.

# proxmox-backup-manager remote create pbs2 --host pbs2.ostechnix.lan --userid sync@pam --password 'SECRET' --fingerprint 88:35:ef:e4:82:c8:97:99:77:0:a1:d8:c0:c2:2b

Replace the hostname, username, password and the fingerprint with your own.

Traffic Control

As you know, creating and restoring backups will consume a lot of traffic, especially in large production environment. This will affect other users when they are accessing a shared storage.

Fortunately, we can control network traffic for clients within specified networks using a token bucket filter (TBF). This feature avoids network congestion and prioritize traffic from specific hosts.

Traffic Control
Traffic Control

Certificates

In Certificates section, we can upload, view and delete custom SSL certificates. In addition to that, we can also add and manage ACME accounts.

Certificates Section
Certificates Section

The Certificates section can be accessed from Configuration -> Certificates link.

Subscription

The Subscription section allows us to upload Proxmox subscription key, view the subscription status, remove subscription and access a system report in a plain text format.

Subscription Section
Subscription Section

This section can be accessed from Configuration -> Subscription tab.

Administration

This is an important section where you can view and manage the PBS server's resources, services, updates, repositories, system logs and tasks.

Under the "Server Status" tab, you will find the following system resource reports:

  • CPU usage
  • Server load
  • Memory usage
  • Swap usage
  • Network traffic
  • Root Disk usage such as transfer rate, I/O operations statistics, and I/O delay etc.
Server Administration Section
Server Administration Section

You can also view the package versions, open console, reboot and shutdown your PBS server from the "Server Status" tab.

The "Services" tab shows you the list of running and stopped services.

You can refresh the software repository list and update the installed packages from the "Updates" tab.

Under "Repositories" tab, you can add new software repositories, enable or disable repositories and reload them.

The "Syslog" tab shows you the system logs. You can also see what's happening in your PBS server in real time by clicking on the "Live mode" button. If you want to view the logs between a specific time period, choose "Select Timespan" button and select the starting date and ending date and click "Update" button.

In the "Tasks" tab, you can view the list of scheduled jobs e.g. Log rotation.

The Administration section is further divided into 2 more sub-sections namely Shell and Storage / Disks.

Shell

The "Shell" section allows you to access the console of your Proxmox Backup Server. From the Console, you can manage your PBS server and perform all administrative tasks.

PBS Shell
PBS Shell

Storage / Disks

Under "Storage / Disks" section, you can initialize disks, create various filesystems, and get information about the disks.

To view the list of attached disks and their details (E.g. partitions, partition type, size etc), click the "Disks" button.

PBS Storage Section
PBS Storage Section

As you see in the above screenshot, I have two disks attached two disks (/dev/sda and /dev/sdb) with my PBS. The /dev/sda disk is used for OS and the /dev/sdb disk is used for storage. The /dev/sdb disk is unused right now.

Select the unused disk (i.e. /dev/sdb in my case) and click "Initialize Disk with GPT".

Initialize Disk with GPT
Initialize Disk with GPT

Now you can create an ext4 or xfs filesystem on the unused disk by navigating to Storage/Disks -> Directory. Choose the unused disk (e.g. /dev/sdb) from the Disk drop-down box, and then select the filesystem (e.g. ext4) you want to use for the directory, and finally enter a name for the directory (e.g. backups). Make sure you have checked box that says "Add as Datastore", so you could use this directory as a datastore to save the backups.

Create a Directory
Create a Directory

Now you will see the newly created directory called "backups" under the "Directory" tab as well as under the "Datastore" section. Now we have a space where we can send the backups.

Proxmox Datastore Directory
Proxmox Datastore Directory

You can also create a zpool with various raid levels by navigating to Storage/Disks -> ZFS in the web interface.

Heads up: Please note that you must need an unused disk to create a new filesystem. If you have only one disk, you can not create additional directories or filesystems.

Tape Backup

If you deal with lot of data backups everyday, you must aware of 3-2-1 backup strategy.

The 3-2-1 backup strategy states that you should have 3 copies of your data (your production data and 2 backup copies) on two different media (disk and tape) with one copy off-site for disaster recovery.

Fortunately, Proxmox tape backup feature allows you to store datastore content on magnetic tapes by default. By utilizing the tape backup, you can keep an additional copy of the data, on a different media (i.e. tape), and move the tapes to different location (off-site).

Tape Backup in Proxmox Backup Server
Tape Backup in Proxmox Backup Server

You can retain backups for several years in tapes. The one down-side of tape backups is restoring from tape can take much longer than restoring from disk.

Datastore

A Datastore simply refers to a location at which your backups are stored. In other words, a datastore is a directory to store the backup data.

A datastore is identified by an unique ID. Each datastore has associated retention settings of how many backup snapshots for each interval of hourly, daily, monthly, yearly and time-independent number of backups to keep in that datastore.

You can also configure to collect garbage and prune and remove backups periodically. The configuration details of datastores are stored in the file /etc/proxmox-backup/datastore.cfg.

Create New Datastore in Proxmox Backup Server GUI

A minimum of at least one datastore needs to be configured. And there is no limit for the maximum number of datastores.

Remember we already created a datastore in "Storage/Disks" section earlier? So we don't need to create it again. Just in case if you want an additional datastore, follow the steps given below.

To create a new datastore, click "Add Datastore" under the "Datastore" section from the left side bar.

Under the "General" tab, enter the following details:

  • Name of the datastore in the Name field,
  • The path to the directory (E.g. /mnt/datastore/backups1) where you want to create the datastore in the "Backing Path" field,
  • The time and intervals at which garbage collection runs in the "GC Schedule" drop-down box,
  • The frequency at which pruning takes place in the "Prune Schedule" drop-down box,
  • Add some contextual information to the datastore in the "Comment" box.
Create a New Datastore in Proxmox Backup Server
Create a New Datastore in Proxmox Backup Server

Under the "Prune Options" tab, set the amount of backups which you would like to keep.

Prune Options

After entering the aforementioned details, click "Add" button to create the datastore.

Done! Now we can see the newly created datastore under the "Datastore" section.

Proxmox Datastores
Proxmox Datastores

As you can see, I have created two datastores namely backups and backups1.

Click on any datastore to view further details of the chosen datastore.

The "Summary" section of the datastore show the overview of the overall storage usage by the datastore, and storage of VMs, containers and hosts, storage usage in bytes in a nice graph format, transfer rate in bytes per second, I/O operations per second, and IO delay in milliseconds.

Datastore Summary
Datastore Summary

The "Content" section shows the backups of VMs and Containers. Since it is my new PBS setup, I don't have any backups yet.

View Datastore Contents
View Datastore Contents

The "Prune & GC" tab shows you garbage collection schedule, and the list of configured Prune jobs. Prune jobs are configured to periodically prune a datastore or a subset of it. You can add new jobs and manage them from this tab.

Add a New Prune Job
Add a New Prune Job

Under the "Sync Jobs" tab, you can create a new Sync job. Sync jobs are configured to pull the contents of a datastore on a Remote to a local datastore.

Create a New Sync Job
Create a New Sync Job

Proxmox Backup Server offers various verification options to ensure the backups are intact. From the "Verify Jobs" tab, you can create a new Verify job and schedule it at specific time interval to run the verification of backup data.

Add a New Verification Job
Add a New Verification Job

Under the "Options" tab, you will see the list of configured options related to the datastore. You can edit a configured item by choosing it and clicking the "Edit" button.

Datastore Options
Datastore Options

If you don't need a Datastore, simply click "Remove Datatsore" button on the far right side.

Remove Datastore
Remove Datastore

By default, Configuration change will only be deleted. No data will be deleted. If you want to delete a datastore including its contents, make sure you have ticked the "Destroy all data" checkbox.

Confirm Deleting Datastore
Confirm Deleting Datastore

Except the "root" user, new users and API tokens do not have any permissions by default. Under the "Permissions" tab, you can add permissions to a new user if you want to allow the user to access Proxmox datatsore.

Well, we have created datastores. Now it is time to link the Proxmox Backup Server with the Proxmox Virtual Environment in-order to backup the Proxmox Containers and VMs to PBS.

Get Fingerprint of PBS

Before adding PBS to Proxmox VE, you need to get the fingerprint of your Proxmox Backup Server.

To find the fingerprint of PBS, go to the Dashboard of your Proxmox Backup Server and click "Show Fingerprint" button.

Show Proxmox Backup Server's Fingerprint
Show Proxmox Backup Server's Fingerprint

You will see the fingerprint of your PBS. You need to click on the "Copy" button to copy the fingerprint and paste it in the "Fingerprint" column in one of the following steps.

Copy Proxmox Backup Server's Fingerprint
Copy Proxmox Backup Server's Fingerprint

Add Proxmox Backup Server in Proxmox Virtual Environment

Open the Proxmox VE Admin web interface by navigating to URL https://proxmox-ve-ip-address:8006 from your web browser. Enter the username and its password to access Proxmox VE dashboard.

Access Proxmox VE Dashboard
Access Proxmox VE Dashboard

Now we should add the Proxmox Backup Server as a remote storage in Proxmox VE.

To add PBS in Proxmox VE, navigate to "Datacenter -> Storage" from the Proxmox VE dashboard.

Go to Storage Section in Proxmox VE
Go to Storage Section in Proxmox VE

Click the "Add" button and choose "Proxmox Backup Server" from the drop-down list.

Add Proxmox Backup Server as Remote Storage in Proxmox VE
Add Proxmox Backup Server as Remote Storage in Proxmox VE

Enter the following details:

  • Type an ID for your Proxmox Backup Server (E.g. Pbs).
  • Enter the IP address in the "Server" field.
  • Enter Username of your PBS server (E.g. root@pam is the default admin user) and its password.
  • Paste Fingerprint of your Proxmox Backup Server which you copied in the earlier steps.
  • Finally, enter the name of the Datastore (E.g. backups) which we created in the earlier steps
Add Proxmox Backup Server in Proxmox Virtual Environment
Add Proxmox Backup Server in Proxmox Virtual Environment

After entering the aforementioned details, click "Add" to link PBS with your Proxmox VE.

Congratulations! Proxmox Backup Server is added an additional remote storage in your Proxmox VE. You can view it under the "Storage" section as well as in the left side bar.

Proxmox Backup Server is added in Proxmox VE
Proxmox Backup Server is added in Proxmox VE

It is time to backup your containers and VMs.

Backup and Restore Proxmox VMs

We can copy a single or multiple VMs at a time. First, we will see how to backup a single Proxmox virtual machine.

Backup Proxmox VMs to Proxmox Backup Server

Click on a VM that you want to backup, and select "Backup" on the right side bar and again click "Backup now" on the top bar.

Backup a Proxmox VM
Backup a Proxmox VM

Now choose where do you want to store the backup. I choose the Proxmox Backup Server (i.e. Pbs) from the "Storage" drop-down box.

Choose Pbs as Storage
Choose Pbs as Storage

Next choose your preferred mode from "Mode" drop-down box. Here, I choose mode as "Snapshot". Finally, click "Backup" button to start backing up the selected VM to the Proxmox Backup Server.

Backup VM to PBS
Backup VM to PBS

Now the Proxmox VM will be backed up to the PBS. Upon successful backup, you will see "Task OK" message at the end of the output.

Backup Successful
Backup Successful

Simply close the output.

View Backups in Proxmox VE Dashboard

To view the backups, simply select the Storage type as "Pbs" and view the backups of the selected VM. Here is the backup!!

View Backups of a VM
View Backups of a VM

You can also select the "Pbs" storage on the left side bar and click "Backups" section on the right side bar. Here you will see the list of all backups.

View all Backups
View all Backups

PBS usually saves the virtual machine as "vm/vm-id". For instance, I have backed up a VM that has ID 106, so it saves the VM as vm/106. As you already know, vm stands for Virtual machine. Similarly, PBS will save the Containers as "ct/container-id" e.g. ct/100. Here, ct stands for container.

View/verify Backups in PBS Dashboard

In the previous section, we saw how to view backups from the Proxmox VE dashboard. We can also verify backups from the PBS dashboard as well.

Login to your Proxmox Backup Server's dashboard. Select the datastore in the left side bar and click "Content" in the top bar to view the backups in PBS dashboard.

View Backups in PBS Dashboard
View Backups in PBS Dashboard

View the Contents of Backups

PBS allows you to view the contents of backups as well. It is quite useful when you want to download a specific file from the backup.

From your Proxmox VE dashboard, go to PBS storage -> Backups. Choose a backup and click "File Restore" on the top bar.

Click File Restore
Click File Restore

You will now see the contents of the virtual hard drive of the selected VM. Simply expand it by clicking on the + (plus) sign to view the VM drive's contents.

View Contents of VM Backups
View Contents of VM Backups

If you want to download a file, simply select it and hit the "Download as" button and then choose the file format (zip or tar). It is that simple!

Restore Proxmox VMs from Proxmox Backup Server

From your Proxmox VE dashboard, go to PBS storage -> Backups. Choose the virtual machine's backup that you want to restore and click "Restore" on the top bar.

Select a Proxmox VM to Restore
Select a Proxmox VM to Restore

Click the "Restore" button to begin.

Restore Proxmox VMs from Proxmox Backup Server
Restore Proxmox VMs from Proxmox Backup Server

By default, Proxmox will restore the VM to your default storage as per the configuration. If you want to restore the VM to different location, click the "Storage" button and choose any other configured storage location.

Restore VM to Different Storage
Restore VM to Different Storage

You can also change the VM's ID, name, number of cores, Memory size before restoring it. This can be useful if you want to clone a VM and keep two identical VMs for any reason.

Change VM Settings Before Restoration
Change VM Settings Before Restoration

Backup and Restore Proxmox Containers

The steps to backup and restore Proxmox Containers is exactly same as backing up and restoring VMs. Let us see how to backup a single container to Proxmox Backup Server.

Backup Proxmox Containers to Proxmox Backup Server

Select a Container -> Backup -> Backup now from the Proxmox VE dashboard.

Backup a Proxmox Container
Backup a Proxmox Container

Choose the storage as "Pbs" and select the backup mode (e.g. snapshot) and hit the "Backup" button.

Backup a Container to Proxmox Backup Server
Backup a Container to Proxmox Backup Server

Since the size of the containers is much smaller than the VM size, the backup should be done much faster.

Container Backup Completed
Container Backup Completed

As stated already, Proxmox will use the name of the backup for the container as ct/container-id (e.g. ct/107), and name of the backup for the Virtual machine as vm/vm-id (e.g. vm/105). So you can easily distinguish which backup is for a container and which one is for a VM.

Viewing Backups in Proxmox VE Dashboard
Viewing Backups in Proxmox VE Dashboard

Verifying the backups and viewing backup contents of Containers is exactly same as before.

Restore Proxmox Containers from Proxmox Backup Server

From your Proxmox VE dashboard, go to PBS storage -> Backups. Choose the Container's backup that you want to restore and click "Restore" button on the top bar.

Select a Proxmox Container to Restore
Select a Proxmox Container to Restore

Select the Storage location where you want to restore the Container, change the VM id, name, RAM size if needed and then click the "Restore" button.

Restore a Proxmox Container from Proxmox Backup Server
Restore a Proxmox Container from Proxmox Backup Server

Just like the backup, the restore process should also complete much faster, because the container's size is very small.

Backup All VMs and Containers

In the previous sections, we discussed how to backup and restore individual VMs and Containers. Now we will see how to automate the backup of all Proxmox VMs and Containers.

From Proxmox VE dashboard, click Datacenter -> Backup -> Add.

Schedule Backups in Proxmox VE
Schedule Backups in Proxmox VE

Set the Storage as "Pbs", schedule time, backup mode and select the VMs and Containers to backup in the Selection mode. I have selected all, so all VMs and Containers will be automatically backed up to PBS. Click "Create" button to create the backup job. As per the below configuration setting, all VMs and Containers will be backed up to my PBS at 2 AM and 10.30 PM.

Create a Backup Job
Create a Backup Job

If you want to backup only a certain VMs and Containers, select "Include selected VMs" from the "Selection mode" drop-down box and select the container(s) and Vm(s) that you want to backup and finally click "Create" button.

Create Backup Job for Selected VMs in Proxmox VE
Create Backup Job for Selected VMs in Proxmox VE

Conclusion

There you go! In this comprehensive tutorial, I have covered pretty much everything to get started with Proxmox Backup Server to backup your VMs and containers hosted in Proxmox VE.

You may be overwhelmed with the PBS setup at first. However, once you properly setup and configured the Proxmox Backup Server, it is quite easy to backup and restore Proxmox VMs and Containers with PBS.

You can configure automatic backup of all Containers and VMs to PBS periodically and let the PBS do the backup for you!!

In our upcoming articles, we will discuss about Proxmox Backup Client application to handle file level backups.

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More