Neuronvm bread crumb arrow icon Docs bread crumb arrow icon Install PostgreSQL 15 on AlmaLinux

How to Install PostgreSQL 15 on AlmaLinux

How to Install PostgreSQL 15 on AlmaLinux
Nicol.G
7m
0 comments
Print
2025/11/14

PostgreSQL has earned a place among the most reliable and advanced open-source database systems in the world. Many developers know it as “Postgres”, a database engine that has evolved for more than three decades while staying true to SQL standards. Its combination of performance, stability, and scalability has turned it into the preferred storage layer for companies like Instagram / Spotify, Trivago, Netflix, and hundreds of modern SaaS platforms.

In this guide, you will learn how to Install PostgreSQL 15 on AlmaLinux in a clean, structured, and secure manner. Along the way, we will review important points, version differences, the reason for each step / and the most optimal setup method so that the article is not just a guide, but a reliable reference for users.

Image of Setup PostgreSQL 15 on AlmaLinux

What Is PostgreSQL and Why Is It Widely Used?

PostgreSQL is an advanced relational database management system (RDBMS) built to handle large-scale, structured data while providing support for both relational SQL queries and JSON-based non-relational operations!!! This dual feature makes Postgres suitable for both Enterprise applications and lighter applications such as web projects.

Reasons for PostgreSQL’s popularity:

  • Standardization and strict support for SQL
  • Stable architecture in projects with large data volumes
  • Extensibility by adding new extensions and types
  • Support for different operating system versions, from Unix to Windows and macOS

This system was originally designed for Unix environments, but over the years it has become a cross-platform RDBMS.

Key Features of PostgreSQL

PostgreSQL is famous for its wide range of features. Some of its most important features:

  • Table inheritance
  • Sophisticated locking mechanism for concurrency management
  • Foreign key referential integrity
  • User-defined types
  • Asynchronous replication
  • Multi-Version Concurrency Control (MVCC)
  • Nested transactions or savepoints
  • Full support for Views, Rules and Subqueries

Features added in newer versions:

  • Support for Tablespaces
  • Native version for Windows Server
  • Point-in-Time Recovery capability for accurate database recovery

These features make PostgreSQL a good choice for sensitive projects and enterprise databases .

How to Setup PostgreSQL 15 on AlmaLinux

To complete the installation steps, you need a Linux VPS or AlmaLinux server. Below, we will go through each step with an explanation and why it is performed.

Step 1: Add the PostgreSQL Repository

The default version available in AppStream is usually older. For this reason, the official PostgreSQL repository must be added to install PostgreSQL 15.

Show available modules:

sudo dnf module list postgresql

Install PostgreSQL repository:

AlmaLinux 9:

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

AlmaLinux 8:

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

This repository allows you to install the latest official version of PostgreSQL.

Step 2: Install PostgreSQL 15

First update the repositories:

sudo dnf update -y

Disable the default PostgreSQL module (to avoid conflicts):

sudo dnf -qy module disable postgresql

Install PostgreSQL 15:

sudo dnf install -y postgresql15-server

Check the installed version:

psql -V

Step 3: Initialize the PostgreSQL Database

Before running the service, an initial database must be created. This will create a new cluster.

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

Step 4: Start and Enable PostgreSQL Service

Start the service:

sudo systemctl start postgresql-15

Enable the service to run after reboot:

sudo systemctl enable postgresql-15

Check the status:

sudo systemctl status postgresql-15

Step 5: Connect to PostgreSQL

After installation, a postgres user is created without a password. To log in to the database environment:

sudo su - postgres

psql

Step 6: Set a Password for the Postgres User

For increased security:

sudo passwd postgres

Then log in to the postgres account:

su ​​- postgres

Set the password in psql:

psql -c "ALTER USER postgres WITH PASSWORD 'your-password';"

From now on, logging in to the database requires authentication.

Conclusion

Setting up PostgreSQL 15 on AlmaLinux is not a complicated task, but following the steps in order and using the official repository is very important. In this article, in addition to explaining the installation, we tried to explain the reason for each step and security tips to make the PostgreSQL Setup experience easier and more professional for users. PostgreSQL is a powerful database for mobile and web applications and can be run on almost any operating system. If you have any questions or need a more specialized review, you can ask in the comments section.

Share this Post
How useful was this post for you?
0 Points from 0 votes
Frequently Asked Questions

PostgreSQL offers a mix of stability, extensibility, and standardization that is not found in many other databases. Simultaneous support for SQL and JSON, a stable architecture at high volumes, extensible plugins, and granular recovery tools make it a safer choice for Enterprise and SaaS projects.

Yes. AlmaLinux’s AppStream usually provides older PostgreSQL versions, and this can limit new features, security, or plugin compatibility. The official PostgreSQL repository ensures that the latest stable version is installed, with security updates and full features.

The initdb command initializes the database cluster, creates the initial structure of the system tables, and creates the environment necessary for the PostgreSQL service to run. Without this step, the database will not be able to store data or perform management processes.

Nicol.G

Leave a reply

Calculate the value of (5 - 2) :

Save my name and email in this browser for the next time.

Last Comments

Show More
© Copyright 2025 NeuronVM.
Use of this Site is subject to express terms of use