

In the next step, we shall create a password for the postgres user for security reasons.įor now, we are going to log in to the PostgreSQL shell by first switching to the postgres user. It does not require any authentication and a password is therefore not required to log in. When PostgreSQL is installed, a default database user called postgres is created. To confirm that PostgreSQL is up and running, execute: $ sudo systemctl status postgresql-15įrom the output, it’s clear that our database server is running as we would expect. Thereafter, start the PostgreSQL database server. But before that, enable PostgreSQL to start on boot time. Once PostgreSQL is installed and initialized, the next step is to start the service and ensure the database server is running. Initialize PostgreSQL Database Step 4: Start and Enable PostgreSQL Service So, to initialize the database, run the command: $ sudo /usr/pgsql-15/bin/postgresql-15-setup initdb A cluster is a group or collection of several databases that are managed by a cluster. Psql (PostgreSQL) 15.0 Step 3: Initialize the PostgreSQL Databaseīefore proceeding further, we need to initialize the initdb database which is responsible for creating a new PostgreSQL cluster. You can confirm the version of PostgreSQL installed using the command: $ psql -V At the very end of the installation, you should have the output displayed which indicates that all the packages were successfully installed. The command installs the PostgreSQL server and client alongside other dependencies. Type 'Y' and hit ENTER every time you are prompted to import the GPG key. $ sudo dnf install -y postgresql15-server Once the default module is disabled, proceed and install PostgreSQL 15 client and server as shown. Next, disable the default module which, as we saw earlier, is PostgreSQL 10.

Simply run the following command to achieve this: $ sudo dnf update -y With the PostgreSQL YUM repository in place, the next step is to update repositories. Step 2: Install PostgreSQL 15 on Rocky/Alma Linux To install the latest PostgreSQL version, we need to, first, install the PostgreSQL YUM repository on our system as shown. From the output, we can clearly see that the default PostgreSQL stream – marked with is PostgreSQL 10.
