Install/Configure PostgreSQL on CentOS 8

Spread the love

In my current organization, we have lot of postgres databases running on linux. So thought to learn the same by building my own CentOS 8 vm on VirtualBox.

Below are the steps required for installation and configuration of PostgreSQL server on CentOS 8:-

  1. Go to https://www.postgresql.org/download/, and choose Linux & ‘Red Hat/CentOS’ as distribution.

2. On next page, select appropriate version/platform/architecture

3. Based on the selection of step 2 details, we get appropriate Linux commands. Below are the commands for PostgreSQL 12 on CentOS 8:-

With above step 3 installation is complete. But I want to access this Postgres server from my host machine using pgAdmin/psql SQL Shell. So below are the steps required to make this happen:-

Now, we need to modify 2 config files to allow/listen connectivity for other machines.

With the above steps, we are done with required changes. Last part is to restart Postgresql-12 services.

Now, let’s connect the above server using pgAdmin installed on my host machine. In case this does not work, I would reboot Linux VM once.

With this, we should be good to install/configure/start using postgres. In case of other linux os, only the installation part (first 3 steps) would differ.

I hope this has been helpful. Happy Coding 🙂

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.