How to install PostgreSQL 12 server on Centos 8

A simple set of instruction on how to install PostgreSQL 12 on Centos 8.x


Install latest repos for EL-8:

Let’s check if Postgres 12 is listed as an installable server.

If you see the ‘PostgreSQL 12’ option listed, we’re good to go.

Let’s install the PostgreSQL 12 packages:

Initialize the database service:

Let’s enable the database service.

Confirm that the service is running:

On Centos 8, the default firewall service needs to be enabled if you expect to connect to Postgres from a remote computer.

Set the password for the PostgreSQL admin user:

Once done, type: exit, to leave Postgres.

If you plan on logging to PostgreSQL 12 from a remote computer, we’ll need to amend the postgresql config file and allow it to listed on all interfaces.

Open this file:

And add to it:

It should look like this, then save it.

Now, configure PostgreSQL to run on the IP address dedicated to the server. Open postgresql.conf

Then change the directive called: ‘listen_addresses’

Save the file and now restart the PostgreSQL 12 database:

Let’s try to connect to it, using your PostgreSQL client, in my case HeidiSQL:

And Voila!, we’re connected:






Facebook Comments