Installing#

Barman official community packages are provided by PGDG.

Note

If you are an EnterpriseDB customer, you should use the packages provided by EDB. This will ensure better compatibility with other EDB products.

There are four packages that make up the suite of Barman features: barman, python3-barman, barman-cli and barman-cli-cloud.

  • barman is the main package and it must be installed.

  • python3-barman is a package that holds the Python libraries of Barman. It is a package required by all the other Barman packages.

  • barman-cli is an optional package that holds the barman-wal-restore and barman-wal-archive utilites. This package is mandatory if you plan to use those utilities as the archive_command or restore_command. It must be installed on each Postgres server that is part of the Barman cluster.

  • barman-cli-cloud is an optional package that holds the barman-cloud-* client scripts that you can use to manage backups in a cloud provider. It must be installed on the Postgres servers that you want to back up directly to a cloud provider, bypassing Barman.

Note

Barman packages can be found in several different repositories. Unless you have an EDB subscription, we recommend using PGDG repositories, because it ensures compatibility, stability and access to the latest updates.

Warning

Do not upgrade Barman using different repositories. By doing so you risk losing your configuration as each source repository provides different packages, which use different configuration layouts.

System requirements#

The minimal system requirements needed to run a Barman server are the following:

  • Linux operating system (Debian, Ubuntu, RHEL, Rocky, Fedora, etc.) or UNIX-like operating system (FreeBSD, OpenBSD, etc.)

  • Python 3.12 to 3.14

  • Python modules:

    • psycopg2 >= 2.4.2: Required to connect to the Postgres server

    • python-dateutil

    • argcomplete (optional)

  • PostgreSQL client tools: Required to interact with the Postgres server

  • PostgreSQL server >= 13

  • rsync >= 3.1.0: Required for recovery and Rsync backups

  • boto3 >= 1.29.1: Required when using backup_method = snapshot together with the snapshot lock feature on AWS

  • file POSIX command, generally provided by the file package

  • tar command, generally provided by the tar package: Required whenever restoring compressed or cloud backups.

Deprecated since version 3.14: Support for versions 3.6 and 3.7 of Python has been deprecated. It is known that Barman 3.14 does not work with Python 3.6. It may work with Python 3.7, but it’s not being tested, nor supported for versions of Python prior to 3.8.

Deprecated since version 3.20: Support for versions 3.8 to 3.11 of Python has been deprecated. Barman 3.20 requires Python 3.12 or later.

Note

Users of RedHat Enterprise Linux, RockyLinux and AlmaLinux are required to install the Extra Packages Enterprise Linux (EPEL) repository <https://fedoraproject.org/wiki/EPEL>

RHEL-based distributions#

You can install barman, barman-cli and barman-cli-cloud using RPM packages on RHEL systems as well as on similar RHEL-based systems like AlmaLinux, Oracle Linux and Rocky Linux.

To begin with the installation, first install the PGDG RPM repository.

Important

The barman-cli-cloud scripts are part of the barman-cli package for RHEL-based distributions from PGDG. Therefore, you only need to install barman-cli to use the cloud scripts.

barman#

To install the barman package. Run as root:

dnf install barman

barman-cli#

To install the barman-cli package, run as root in the Postgres server:

dnf install barman-cli

Note

If you want to use the barman-cloud utilities as hook scripts, you will need to install the barman-cli package in the Barman server.

Debian-based distributions#

You can install barman, barman-cli and barman-cli-cloud using DEB packages on Debian systems as well as on Debian-based systems like Ubuntu.

To begin with the installation, install the PGDG APT repository. This depends on your system:

Important

The barman-cli-cloud package is included among the recommended packages when you install barman-cli.

Before starting the installation, it’s essential to evaluate your use case. If you don’t plan to use the barman-cloud client scripts, such as barman-cloud-backup, you can skip installing barman-cli-cloud as a recommended package when installing barman-cli. However, if you only intend to use the barman-cloud client scripts, you can install the barman-cli-cloud package on its own.

barman#

To install the barman package. Run as root:

apt install barman

barman-cli#

To install the barman-cli package, run as root in the Postgres server:

apt install barman-cli

barman-cli-cloud#

To install the barman-cli-cloud package, run as root in the Postgres server:

apt install barman-cli-cloud

Note

If you want to use the barman-cloud utilities as hook scripts, you will need to install this package in the Barman server.

SLES-based distributions#

You can install barman on SLES systems by utilizing the packages provided in the PostgreSQL Zypper Repository.

To begin installation, you will need to add the appropriate repository by following the detailed instructions available on the PGDG SLES Repository Configuration.

Important

The barman-cli-cloud utilities are part of the barman-cli package for SLES-based distributions from PGDG. Therefore, you only need to install barman-cli to use the cloud scripts.

barman#

To install the barman package. Run as root:

zypper install barman

barman-cli#

To install the barman-cli package, run as root in the Postgres server:

zypper install barman-cli

Note

If you want to use the barman-cloud utilities as hook scripts, you will need to install this package in the Barman server.

Upgrading#

Before upgrading Barman packages, review the following recommendations to ensure a smooth and safe upgrade:

  • Review the release notes: Check the release notes for the target version to identify any breaking changes, deprecated options, or new requirements that may affect your setup.

  • Back up your configuration: Make a copy of your Barman configuration files (e.g. /etc/barman.conf and /etc/barman.d/) before upgrading, in case the package update modifies or replaces them. This is usually not necessary, but it’s always good practice to have a backup of your configuration.

  • Ensure no operations are running: Before upgrading, make sure no backup, WAL archiving, or recovery operations are in progress on any of your configured servers.

    • Disable the execution of barman cron during the upgrade to prevent any scheduled tasks from running. You can do this by setting all servers to inactive, or commenting out the cron job in your system’s crontab.

    • Comment any cron job that would execute barman backup during the upgrade.

    • Stop the receive-wal process for each configured server to prevent possible issues with WAL archiving during the upgrade. You can do this by running:

      barman terminate-process SERVER_NAME receive-wal
      
  • Use the same repository: Upgrade Barman using the same package repository that was used for the original installation. Mixing repositories can result in configuration layout mismatches or broken packages.

  • Verify Python compatibility: Confirm that the Python version on your system is supported by the new Barman release. Refer to System requirements for supported versions.

  • Test before upgrading production: When possible, test the upgrade in a non-production environment first to catch any issues before applying it to your production Barman server.

Additional Requirements#

Some Barman features — such as cloud storage integration and data compression — depend on optional Python libraries. These dependencies are not included by default when installing Barman through your system’s package manager.

To enable functionalities such as barman-cloud, Snapshot Backups, or certain compression algorithms, you must install the appropriate extra dependencies listed in the table below. Make sure that these dependencies are installed for the same Python interpreter used by Barman.

Optional Libraries

Feature / Provider

Required Libraries

AWS S3

boto3

AWS EC2 Snapshots

boto3

Azure Blob Storage

azure-identity, azure-storage-blob

Azure VM Snapshots

azure-identity, azure-storage-blob, azure-mgmt-compute

Google Cloud Storage

google-cloud-storage

GCP Compute Snapshots

grpcio, google-cloud-storage, google-cloud-compute

Snappy Compression

python-snappy, cramjam >= 2.7.0

Zstandard Compression

zstandard

LZ4 Compression

lz4

Autocompletion

argcomplete

Tip

If you encounter ModuleNotFoundError when using barman-cloud, verify that:

  1. You installed the libraries with the same Python interpreter used by Barman.

  2. The installation completed successfully without permission or network errors.