How to Install PostgreSQL 13 on CentOS 8
In this tutorial, we'll walk you through the installation and initial configuration of PostgreSQL 13 on CentOS 8. Updates for PostgreSQL 13 will be released for five years through November 2025. You must run all commands as root.
In the Serverspace you can create a server with already installed app "Postgres".
Installing PostgreSQL 13 packages
Add PostgreSQL repository to the system.
Turn off the PostgreSQL modules with an older version present in the system.
Let’s install PostgreSQL 13 server.
Initial configuration
Initialize the database.
Initializing database ... OK
Start and enable autostart of the PostgreSQL service.
Set a password for the postgres user.
psql -c "alter user postgres with password 'psql-user-pass'"
ALTER ROLE
exit
logout
Creating a new PostgreSQL user
To create a new user in PostgreSQL, you first need to create it in the system itself.
passwd username
Log in as postgres.
Create a database user.
Create a database for this user.
The new user can now work with PostgreSQL. Let’s log in. Enter username’s password when prompted.
Password:
Enter the PostgreSQL command line.
psql (13.1)
Type "help" for help.
username=>