How to install and configure PostgreSQL 16 on Fedora Linux

In this article, we have shown How to install and configure PostgreSQL 16 on Fedora Linux step by step.

Install and Configure PostgreSQL 16 on Fedora

1. Add the Repository RPM for PostgreSQL16 on Fedora.

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/F-38-x86_64/pgdg-fedora-repo-latest.noarch.rpm

How to install and configure PostgreSQL 16 on Fedora Linux

2. Now install PostgreSQL 16 on Fedora using below command.

sudo dnf install -y postgresql16-server

We have successfully installed PostgreSQL 16 on Fedora Linux operating system.

PostgreSQL post installation steps:

1. Initialize the database by running below command:

sudo /usr/pgsql-16/bin/postgresql-16-setup initdb

2. Now, enable the PostgreSQL service on Fedora.

sudo systemctl enable postgresql-16

3. Start the PostgreSQL service in Fedora by running below command.

sudo systemctl start postgresql-16

4. Now connect to PostgreSQL server on Fedora:

sudo su - postgres psql

5. Now set the password for the user postgres:

alter user postgres with password 'admin@123';

So, we have succesfully installed and configured PostgreSQL 16 on Fedora Linux.