How to install PostgreSQL on CentOS 7.3 Server

Welcome to CentOS Tutorial. This tutorial is going to show you how to install PostgreSQL on CentOS 7.3 Server. As you know PostgreSQL is an open source object relational management system (RDBMS). It’s a popular database system together with MySQL/MariaDB. PostgreSQL is available in CentOS repository, so we can easily install this database server. We can install PostgreSQL on local system or remote cloud system. For example, if you have an Amazon EC2 machine, you can install PostgreSQL system there. When this post is written, PostgreSQL 9.2.23 is available through the CentOS repository. This tutorial is presented by

Steps to install PostgreSQL on CentOS 7.3 

Step 1. Login to the CentOS 7.3

Connect and login to CentOS 7.3 via SSH. You can use Putty (Windows) or simply use Terminal console and use ssh command to connect. 

Step 2. Install PostgreSQL

Now execute this command to install PostgreSQL from CentOS repository

Output example

Wait until the installation completed. 

Step 3. Configure PostgreSQL

Initialize PostgreSQL

Start and Enable PostgreSQL

Check status

Step 4. Configure User Access

By default, PostgreSQL create a new user called postgres to access the database. We need to change the password for this user for security reason. 

Change user postgres Linux password

Change user postgres database user. Please change the ‘12345678’ with your actual password. Please note that this is the user that have administrative access to PostgreSQL. 

Step 5. Access the PostgreSQL 

Now we will try to access the PostgreSQL server via Terminal using psql command. First we need to login using postgres user. 

Now enter PostgreSQL console with this command

Here you can do many things to manage your database such as create new database, etc. Thanks for reading this How to install PostgreSQL on CentOS 7.3. Cheers and Have a nice day

1 Trackback / Pingback

  1. How to Enable Remote Access on PostgreSQL Server

Leave a Reply

Your email address will not be published.