Reading Time: 3 minutes

Veeam Backup and Replication support PostgreSQL (only on Linux) using Application-Aware and Guest Processing.

Only in this way you can than use the Veeam Explorer for PostgreSQL during restore, but note that it support only the following PostgreSQL versions on Linux machines: PostgreSQL 12, 13, 14, 15, 16, 17. For more information see the system requirements.

To create a transactionally consistent backup of PostgreSQL VM, you must enable application-aware processing and define the settings of WAL files processing.

I’ve tested the procedure using a VM with

  • Rocky Linux 9.5 and PostgreSQL 13 (the version included in Rocky Linux)
  • Ubuntu Linux 22.04 LTS with PostgreSQL 14 (the version included in Ubunt Linux)

In the Guest Processing setting you have to enable application-aware processing and also specify Guest OS credentials.

The account specified at the Guest Processing step must be a Linux user elevated to root. The account must have the home directory created.

In my case, I’ve just create a veeam user (with password)… for a Rocky Linux distribution:

sudo adduser veeam
sudo passwd veeam
sudo usermod -aG wheel veeam

For a Ubuntu Linux distribution:

sudo adduser veeam
sudo usermod -aG sudo veeam

Then click on Applications button.

  1. In the Processing Settings window, click the PostgreSQL tab.
  2. From the Specify PostgreSQL account with superuser privileges drop-down list, select a user account that Veeam Backup & Replication will use to connect to the PostgreSQL instance. 

To back up PostgreSQL instances, the account must have the superuser privileges for the PostgreSQL instance. For more information, see PostgreSQL documentation.

There are three different way to specify the database credential. I’ve choose the system user to avoid specific database user creation (was a requirement for a service provider).

System user without password file (peer) if you want Veeam Backup & Replication to use the peer authentication method. In this case, Veeam Backup & Replication will use the account you specified at the step 2 as the OS account and as the PostgreSQL account to connect to PostgreSQL. For more information about the peer authentication method, see PostgreSQL documentation.

The user postgres is without password and is the default database sysadmin in Rocky Linux.

To enable peer authentication method you need the folloging rows in the /var/lib/pgsql/data/pg_ident.conf (on Rocky Linux) or /etc/postgresql/14/main/pg_ident.conf (on Ubuntu Linux) file:

#PostgreSQL User Name Maps
#MAPNAME SYSTEM-USERNAME PG-USERNAME
backup postgres postgres 
backup veeam    postgres 

Then you need to configure also the /var/lib/pgsql/data/pg_hba.conf (on Rocky Linux) or /etc/postgresql/14/main/pg_hba.conf (on Ubuntu Linux) file:

#Veeam
local all postgres peer map=backup

To check that the user is configured properly you can try to connect to the database using this command:

sudo -u veeam psql -U postgres

Now you can run the backup… if all is working properly, you will see the database backup in your /var/lib/pgsql/data/log/postgresql-*.log (on Rocky Linux) or /var/log/postgresql/* (on Ubuntu Linux) file with some rows like this:

2025-05-10 17:08:36.851 CEST [16316] LOG: restore point "2025-05-10 15:08:36 GMT" created at 0/3000090
2025-05-10 17:08:36.851 CEST [16316] STATEMENT: SELECT CAST(pg_create_restore_point AS varchar) FROM pg_create_restore_point($1);

Finally you can use the Veeam Explorer to manage DB restore:

Share