Install PostgreSQL 18 on Oracle Linux 10

PostgreSQL is one of the most used database management systems. It is robust, highly available and easy to install. PostgreSQL is an open-source, advanced and enterprise class relational databases which supports both SQL (relational) and JSON (non-relational). It is a highly stable database system backed by a community of developers. It is used as a primary database for many web applications and also mobile and analytics applications. PostgresSQL supports a wide range of languages which include: Java, Python, C#, Ruby, JavaScript (Node.js), Perl, C/C+, go and Tcl.

Features of PostgreSQL

PostgreSQL has many advanced features as compared to other database management systems. These include:

  • Table inheritance.
  • Nested transactions.
  • Multi-version concurrency control.
  • Sophisticated locking mechanism.
  • Foreign key referential integrity
  • Asynchronous replication.
  • Views, rules and subquery.

The current versions of PostgreSQL support the following additional features.

Installing PostgreSQL 18 on Oracle Linux 10

The following steps guide on how to install PostgreSQL on Oracle Linux 10.

Step 1: Update system packages

It is always good to ensure that your system is up to date when carrying out installations.

sudo dnf update

Step 2: Add PostgreSQL repository

Use the below command to add the official PostgreSQL on Oracle Linux 10.

sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Step 3: Install PostgreSQL on Oracle 12 on Oracle Linux 10

We need to disable any other existing PostgreSQL if there is then install PostgreSQL 18. Run the below commands:

sudo dnf module disable postgresql
sudo dnf install -y postgresql18-server

When installation is complete, you should see an output as below:

Step 4: Initialize and start Database Service

We first need to initialize database before starting. Use the following command:

$ sudo /usr/pgsql-18/bin/postgresql-18-setup initdb
Initializing database --- OK

Now we can start and enable database service.

sudo systemctl enable --now postgresql-18

Confirm status if postgresql is running using the below command.

sudo systemctl status postgresql-18

The output should be as below if running:

If running Firewall service and remote clients should connect to your database server, allow PostgreSQL service.

sudo firewall-cmd --permanent --add-service=postgresql
sudo firewall-cmd --reload

Step 5: Set PostgreSQL admin user

To set PostgreSQL admin user, run:

$ sudo su postgres
$ psql -c "alter user postgres with password 'MyStrongPassword'"
ALTER ROLE

Step 6: Enable Remote Access

Edit Postgresql configuration file to set listen address. You can set to your system IP address or use ‘*’ for any.

sudo vim /var/lib/pgsql/18/data/postgresql.conf 

Add listen address as shown:

listen_addresses = '192.168.100.178'
#OR 
listen_addresses = '0.0.0.0'

Also allow remote connection by editing the shown the below file

sudo vim /var/lib/pgsql/18/data/pg_hba.conf

Add the following content

# Accept from anywhere
host all all 0.0.0.0/0 md5
# Accept from specific subnets
host all all 192.168.1.0/24 md5

Restart database service after the changes

sudo systemctl restart postgresql-18

Test remote connection by using the shown command:

$ psql -U <dbuser> -h <serverip> -p 5432 <dbname>

This has been a step by step guide on how to install PostgreSQL on Oracle Linux 10.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Unlock the Right Solutions with Confidence

At CloudSpinx, we don’t just offer services - we deliver clarity, direction, and results. Whether you're navigating cloud adoption, scaling infrastructure, or solving DevOps challenges, our seasoned experts help you make smart, strategic decisions with total confidence. Let us turn complexity into opportunity and bring your vision to life.

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

In this guide, we are going to look at how to install MongoDB 8.0 on Oracle Linux 10. MongoDB is […]

Python is known to be a powerful and easy to learn programming language. It is designed to be efficient, simple […]

In this short tutorial I’ll guide you through the installation of PostgreSQL 17 on Amazon Linux 2023. PostgreSQL is a […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.