Install PostgreSQL

This page describes how to install PostgreSQL on RedHat Enterprise Linux or derivatives.

Step 1: Install PostgreSQL 16

For most platforms you can install PostgreSQL 16 following the installation guide for your platform.

For RHEL based systems you can also use the PostgreSQL that comes with the distribution.

sudo dnf module install postgresql:16/server

Step 2: Setup a PostgreSQL database for the Inmanta server

Initialize the PostgreSQL server:

sudo su - postgres -c "postgresql-setup --initdb"

Start the PostgreSQL database and make sure it is started at boot.

sudo systemctl enable --now postgresql

Create an inmanta user and an inmanta database by executing the following command. This command will request you to choose a password for the inmanta database.

sudo -u postgres -i bash -c "createuser --pwprompt inmanta"
sudo -u postgres -i bash -c "createdb -O inmanta inmanta"

Change the authentication method for local connections to md5 by changing the following lines in the /var/lib/pgsql/data/pg_hba.conf file.

# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

to

# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

This will make sure you can authenticate using username and password from localhost. If you need password authentication from a different interface, change the 127.0.0.1 and ::1/128 values in the example to the correct interfaces.

Make sure JIT is disabled for the PostgreSQL database as it might result in poor query performance. To disable JIT, set

# disable JIT
jit = off

in /var/lib/pgsql/data/postgresql.conf.

Restart the PostgreSQL server to apply the changes made in the pg_hba.conf and postgresql.conf files:

sudo systemctl restart postgresql