How to install Barman on Ubuntu Server
Barman is an open source backup and recovery tool for PostgreSQL database servers. This tutorial will guide you through the process of installing Barman on the latest version of Ubuntu Server.
Prerequisites
Before proceeding with the installation, it is recommended to have the following:
- Ubuntu Server 20.04 or higher
- A PostgreSQL server installed
- Sudo privileges
Step 1: Add Barman repository
The first step is to add the Barman repository to your system. Run the following command to add the repository:
sudo add-apt-repository ppa:pgbarman/stable
Step 2: Update your packages
After adding the Barman repository, update your package list to ensure you have the latest version available:
sudo apt-get update
Step 3: Install Barman
Now that the repository is added, you can proceed to install Barman:
sudo apt-get install barman
During the installation process, you will be prompted to provide some configuration details such as the PostgreSQL server IP address and port.
Step 4: Configure Barman
Once Barman is installed, you need to configure it to work with your PostgreSQL server. In the /etc/barman.conf file, add the following configuration:
[example]
description = example PostgreSQL server
conninfo = host=<postgresql_server_ipaddress> port=<postgresql_server_port> user=<postgres_user> password=<postgres_password>
backup_method = rsync
Replace the placeholders with your PostgreSQL server IP address, port, user, and password.
Step 5: Start using Barman
After completing the configuration, you can start using Barman to manage your PostgreSQL server backups. To list available backup commands, run:
barman example
To back up the PostgreSQL database, run:
barman backup example
Congratulations! You have successfully installed and configured Barman on Ubuntu Server.