For the installation of our PostgreSQL database, we need to log in to our server with the privileges of the root user.
1- Installing PostgreSQL from CentOS 7 repositories is relatively simple. We will start by executing the following command:
# yum install postgresql-server postgresql-contrib
2- At the end of the installation we start the configuration of our PostgreSQL database with the following command:
# postgresql-setup initdb
3- We start our PostgreSQL database
After starting the configuration of our PostgreSQL database, we start it with the following command:
# systemctl start postgresql
4- Enable PostgreSQL
Finally, we enable our PostgreSQL database to start automatically and permanently at each system startup.
# systemctl enable postgresql