Guide to Installing PostgreSQL 15 on AlmaLinux 8

VPTS Team Content has been moderated
Published date:12/11/2025 Update:16/7/2026 Views:165 Reviews: 5.0/580reviews
VPTS on

PostgreSQL is an open-source relational database management system widely used for websites, APIs, management software, enterprise systems, and various applications requiring stable data processing.

Guide SQLVPS

In this article,VPTSwill guide you through installing PostgreSQL 15 on AlmaLinux 8 using the official PostgreSQL repository. Content covers system updates, installing PostgreSQL, initializing database clusters, creating users, creating databases, configuring remote access, and opening the firewall securely.

PostgreSQL Installation Steps

Step 1: Update the system

  • To keep your Linux system updated and stable, run the following dnf command to upgrade software packages
dnf update -y
PostgreSQL on AlmaLinux

Step 2: Enable the official PostgreSQL repository

  • PostgreSQL version 15 is not available in AlmaLinux's default repository, so you need to add the official repository:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
PostgreSQL on AlmaLinux
  • Disable the system's default PostgreSQL
sudo dnf -qy module disable postgresql

Step 3: Install PostgreSQL 15

Install PostgreSQL 15 and server components using the command:

sudo dnf install -y postgresql15 postgresql15-server
PostgreSQL on AlmaLinux

Step 4: Initialize database cluster

After installation, PostgreSQL does not yet have a database cluster to store data. You need to initialize it with the command:

sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
PostgreSQL on AlmaLinux

Step 5: Then restart the service

sudo systemctl enable postgresql-15 && systemctl start postgresql-15
  • When the command runs successfully, a message will appearCreated symlink along with the file path.
PostgreSQL on AlmaLinux
  • Check status:
systemctl status postgresql-15
  • If you see:Active: active (running) → PostgreSQL is running properly.
PostgreSQL on AlmaLinux

Step 6: Configure PostgreSQL for remote access

Update n8n when installed via npm (Node.js)

  • To edit text, go toNew SFTP windowand navigate to the file /var/lib/pgsql/15/data/postgresql.conf to edit the text configuration file
  • Update the section: *listen_addresses = '' **as shown below and Save
PostgreSQL on AlmaLinux
  • After modifying the configuration file, you need to restart the PostgreSQL service to apply the new settings and enable auto-start.
sudo systemctl restart postgresql-15

Step 7: Set PostgreSQL user password

  • Set a password for the default PostgreSQL user (postgres).
sudo passwd postgres
PostgreSQL on AlmaLinux

Step 8: Access PostgreSQL Database

  • Once a password has been set for the PostgreSQL user, you can log in to the database server using the psql command
sudo -i -u postgres psql
PostgreSQL on AlmaLinux

**Installation completePostgreSQL 15 on AlmaLinux 8, wishing you every success!**


CONCLUSION

Through the guide above, you can now install PostgreSQL 15 on AlmaLinux 8, initialize a database cluster, create users, create databases, and configure remote connections.

For security reasons, do not expose port 5432 to the entire Internet or allow applications to use the administrative postgres account. Restrict IPs via firewall, use dedicated users, set strong passwords, update PostgreSQL regularly, and schedule periodic data backups.

If you need a Linux VPS to deploy PostgreSQL, websites, APIs, or enterprise software, you can check out the Cloud VPS services atVPTS. The VPS system utilizes SSD/NVMe drives, supports multiple configurations, and is suitable for deploying applications using PostgreSQL databases.

VPTS – Comprehensive Digital Infrastructure Solutions Provider

VPTS is a digital infrastructure solution provider in Vietnam, serving deployment, operation, and data storage needs for individuals, developers, and enterprises. The service ecosystem includesVietnam VPS, International VPS, VPS Anti DDoS, Hosting cPanel, dedicated server, Rack rental, Proxy IPv4/IPv6, S3 MinIOandCloud Storage.

Besides providing infrastructure resources, VPTS also focuses on assisting customers with deployment, configuration, and practical troubleshooting. Content on the VPTS Blog is drawn from common scenarios in operating VPS, servers, and online systems, helping readers understand root causes and apply clear solutions.

VPTS – Stable infrastructure, flexible solutions, and continuous partnership throughout operations.

VPTS Team Contact Information