In this article, we will see How to install and configure PostgreSQL 16 on Oracle Linux server step by step.
Install PostgreSQL 16 on Oracle Linux
1. Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
2. Now disable if any built-in postgresql module is there:
sudo dnf -qy module disable postgresql
3. Install PostgreSQL 16 on Oracle Linux 9/8 Server by running below command:
sudo dnf install -y postgresql16-server
PostgreSQL server post installation steps on Oracle Linux:
1. Initiate the database by running below command:
sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
2. Enable the PostgreSQL 16 service on Oracle Linux:
sudo systemctl enable postgresql-16
3. By default, PostgreSQL 16 service is stopped on the Oracle Linux Server. Start it by running below command.
sudo systemctl start postgresql-16
4. Now connect to the PostgreSQL 16 using psql utility.
sudo su - postgres psql
5. Now, we have set the password for user postgres.
alter user postgres with password 'admin@123';
Now we can create database , table and users.
For further actions about PostgreSQL 16 on Oracle Linux, watch below video: