Why install PostgreSQL from the PGDG repositories on RHEL, Rocky and AlmaLinux
Install PostgreSQL from the PGDG Yum repository when your RHEL, Rocky or AlmaLinux servers must run a specific supported major version rather than whatever the distribution's own packages provide. The PGDG (PostgreSQL Global Development Group) repository is maintained by the PostgreSQL project, so it gives you the version you choose, its minor release stream and matching server, client and extension packages from one source. PostgreSQL itself is released under the PostgreSQL License, a liberal open source license similar to the BSD and MIT licenses, so the software can be installed, modified and run in your own infrastructure without a license fee for the core database.
The version choice drives the rest of the plan. As of the supplied support table, PostgreSQL 14 reaches end of life on November 12, 2026, while 15 is supported to November 11, 2027, 16 to November 9, 2028, 17 to November 8, 2029 and 18 to November 14, 2030. Versions 13 and earlier are already unsupported. Teams usually take this route when an application certifies against a particular major version, when they need a version newer than the distribution ships, or when they must keep several majors in step across a fleet. Confirm the end-of-life dates against the PostgreSQL versioning policy before you set a migration date, because the support window is what decides how long a chosen version stays patched.
Before you commit, confirm three things with your platform team: which major version each application requires, whether your change process accepts a third-party repository on production hosts, and who will track minor releases and apply them. The PGDG route makes that last task a normal package update, but someone still owns the repository configuration, the version pin and the restart window. Writing those owners down now prevents the common situation where a server is installed from one source and then patched from another.
Which PostgreSQL major version and install options fit your estate
This table compares the major version choices, data directory layout and host layout decisions you face before running the PGDG install. Read each row as a decision with its trade-off, and check the support end dates against your own change calendar. The main takeaway is that the version and layout you pick now determine how soon you must upgrade again.
| Decision | Option | Trade-off |
|---|---|---|
| Newest supported major version | PostgreSQL 18, first released September 25, 2025 | Supported until November 14, 2030, but application drivers, extensions and tooling must be confirmed against 18 before cutover |
| Version already in production | PostgreSQL 15, 16 or 17 | Lowest change risk for an existing workload, with support ending November 11, 2027 for 15 and later for 16 and 17 |
| Version 14 for a new build | PostgreSQL 14, end of life November 12, 2026 | Avoid for new installs. Plan a move to a supported major version before this date if you already run it |
| PGDATA on the root filesystem | Data directory under the default path on the OS disk | Simplest to set up, but a full data disk can stop the operating system and makes separate sizing and snapshots harder |
| PGDATA on a dedicated mount | Separate filesystem for the data directory, sized for growth and WAL | More setup and fstab review, but isolates disk exhaustion and lets storage teams manage the volume independently |
| One major version per host | Single PostgreSQL major installed and run per server | Clean patching and rollback boundaries, but more hosts to license, monitor and back up |
| Several major versions on one host | Two or more majors installed side by side with separate data directories and ports | Eases staged upgrades, but shares CPU, memory and disk and doubles the patch and service inventory to track |
Setting up PostgreSQL from PGDG step by step
This sequence takes a RHEL, Rocky or AlmaLinux server from a clean base to a running PostgreSQL instance on a chosen major version, with a check at each stage so you know the install is sound before you build on it.
Confirm OS release and PostgreSQL support status
The administrator who owns the server records the exact RHEL-family release, its vendor support end date, and the PostgreSQL major version to install. Check the chosen major version against the PostgreSQL versioning policy: 18, 17, 16, 15 and 14 are supported, while 13 and earlier are not, and each major version has a published end-of-life date. Confirm the release, kernel and architecture with
cat /etc/os-releaseanduname -m, and confirm the PGDG repository path for that release in the PostgreSQL download instructions. The step is done when the target version, its end-of-life date and the repository path are written into the change record.Add the PGDG Yum repository
The administrator installs the PostgreSQL Global Development Group repository definition for the matching RHEL-family release, using the command given in the official download instructions for that release. Confirm that the repository file lands under
/etc/yum.repos.d/and that the repository is enabled for the correct major release and architecture. Rundnf repolistand confirm that the PGDG entries appear. The step is done when the repository lists with metadata that refreshes without errors, and the output shows the expected repository IDs.Disable the built-in PostgreSQL module
The RHEL-family distributions ship a PostgreSQL application stream that can shadow the PGDG packages. Disable it with the
dnf -qy module disable postgresqlcommand, as described in the PGDG instructions for your release, so that later installs resolve to the PGDG packages. Check the result withdnf module list postgresqland confirm the stream is shown as disabled. The step is done when the module state is disabled and no distribution PostgreSQL stream is set to enabled.Install the chosen major version packages
The administrator installs the server package for the chosen major version, for example
postgresqlfollowed by the major number, along with any client or contrib packages the team needs. Ask the team to decide now whether extensions will be needed, since extension packages have their own names and versions and should be selected deliberately. Confirm the package source withdnf infoand check that the version and repository reported come from PGDG. The step is done when the installed packages match the chosen major version and the package manager reports no unresolved dependencies.Initialize the data directory
Create the cluster with the setup helper or
initdbfor the chosen version, specifying a data directory on the storage volume the team has approved. Enable data checksums at this point if the team requires them, because checksums are set when the cluster is created and are much harder to add later. Confirm the owner and permissions of the data directory belong to the postgres operating system user. The step is done when the initialization completes without errors and the data directory contains the expected cluster files, includingPG_VERSION, which shows the major version.Enable the service to start on boot
The administrator configures the systemd unit for the installed major version so that it starts automatically after a reboot, using the unit name shown in the PGDG instructions for that version. Check that the unit is enabled with
systemctl is-enabledand that the data directory path in the unit or its override file matches the one created in the previous step. Keeping the unit name and data path in the change record makes later upgrades easier to follow. The step is done whensystemctl is-enabledreports enabled for the correct unit.Start the service and verify version and checksums
The administrator starts the service and checks its health in the log, then connects with
psqlas a superuser and runsSELECT version();to confirm the major version. RunSHOW data_checksums;to confirm whether checksums are on, and compare the result with the requirement recorded in the first step. Review the server log for startup errors before the server takes application traffic. The step is done when the server accepts connections, the reported version matches the chosen major release, and the checksum state matches the team's stated requirement.Record the install and set the patch routine
The administrator records the installed package versions, repository source, data directory, service unit and checksum state in the infrastructure record, and sets the server into the normal OS patch process. Minor PostgreSQL releases do not change the storage format, so they are applied by updating the packages and restarting, while major upgrades follow a separate plan. Confirm that the patch tooling retrieves updates from the PGDG repository and that restarts are scheduled. The step is done when the record is complete and a test update run shows the PGDG packages are included in the patch scope.
How minor patches flow through normal RHEL tooling
Minor releases are the routine patch path for a PGDG install, and they reuse the same dnf, service and maintenance tooling your team already runs. The cards below cover the steps that keep a minor update predictable, and they separate that routine work from a major upgrade, which needs a planned data migration.
Keep the PGDG repository enabled
Minor updates arrive through the same PGDG Yum repository used for the initial install, so the repository definition must stay enabled on every database host. Check that dnf resolves the PGDG packages for your chosen major version rather than a distribution copy, and confirm the repository is mirrored if your hosts pull through an internal proxy. A host that quietly falls back to the distribution build will miss the upstream minor releases.
Pin the major version
An operating system update should never move a database from one major version to another. Pin the PostgreSQL packages to the chosen major version (for example, with a dnf versionlock or an exclude rule) and confirm the pin survives a routine dnf update. Keep the built-in module disabled so the distribution stream cannot override the PGDG package set.
Restart after executable replacement
A minor update replaces the server executables, but running backends keep the old binaries until the service restarts. Plan a restart of the postgresql service after each update, and check that the running server reports the new minor version after restart. Standbys and any connection pooler in front of the database need the same review, because each one carries its own restart order.
Review release notes for security fixes
Each minor release lists fixes, and some address security issues that matter for your exposure. Read the release notes before the maintenance window, identify fixes that touch authentication, replication or extensions you run, and record which hosts need the update first. Ask your vendor or internal security team to confirm which fixes apply to your configuration.
Versioning policySchedule maintenance windows
Schedule minor updates in a window that allows a restart, a health check and a rollback decision, with standbys updated before or after the primary according to your failover design. Confirm the window with application owners and record the expected downtime from your own cluster tests. Major upgrades belong in a separate project, since they change the storage format and need pg_upgrade, pg_dumpall and restore, or logical replication.
How the repository, module, packages and data directory connect
The flow starts with the operating system base repository and the PGDG repository, which supply packages side by side. Disabling the built-in PostgreSQL module keeps dnf from resolving the distribution's default version, so the chosen major version's packages install cleanly. Initdb then creates the cluster in PGDATA, and systemd starts the service that points at that directory. Minor patches follow a separate branch through dnf and a restart, while major upgrades create a new data directory and leave the host layout unchanged. Confirm the module name and PGDATA path against the PGDG instructions for your release before you run them.
Package sources, module handling, initdb and service startup on one host.
Security settings to decide at install time
Several PostgreSQL security settings are fixed when the cluster is created or are much harder to change later, so they belong in the install plan. The cards below cover what to decide at initdb, how authentication and network access are set, and how the file system, TLS and package trust fit around the database.
Enable data checksums at initdb
Data checksums can be turned on when the cluster is initialized with the --data-checksums option of initdb. Checksums help detect silent corruption in data pages, and turning them on later is a separate, offline procedure that has to be planned as its own change. Decide this before the first start, and confirm that your backup and monitoring tooling reports checksum failures.
Choose SCRAM over MD5
Set password_encryption to scram-sha-256 before creating roles, and use scram-sha-256 as the method in pg_hba.conf rather than md5. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so new deployments should not start on it. Check that every client driver and connection pooler in your stack supports SCRAM before you go live.
Restrict access in pg_hba.conf
The pg_hba.conf file decides which users, databases and client addresses may connect and which authentication method each one must use. Replace broad rules such as 0.0.0.0/0 or all for every database with narrow entries for named application subnets and roles, and keep listen_addresses limited to the interfaces that need them. Review the file in version control after each change so access decisions can be audited.
Pick authentication methods for your directory
PostgreSQL documents password, GSSAPI, SSPI, LDAP, RADIUS, certificate, PAM and OAuth as client authentication methods. Choose the method that matches how your organization manages identity, such as Kerberos through GSSAPI, LDAP directories, or client certificates for service accounts. Confirm the method on a test instance before applying it to production hosts, because a wrong pg_hba.conf line can lock out administrators.
Set ownership and SELinux context for custom PGDATA
If PGDATA lives outside the default path, the directory must be owned by the postgres user with mode 0700, and SELinux needs a file context that lets the server write there. Use semanage fcontext with restorecon for the new path, rather than turning SELinux off or relabeling the whole disk. Test a restart after the change, since a denied write often shows up only when the service starts.
Plan TLS certificates and repository key trust
Set ssl = on with certificate and key files that your internal CA issued, and confirm that the private key is readable only by the postgres user. Separately, check the PGDG repository signing key fingerprint against the value the PostgreSQL project publishes before you import it, so later patches come from a source you trust. Record both in the build runbook so rotation has an owner and a date.
What buyers ask before installing PostgreSQL from PGDG
How much effort does an in-house PGDG install take, and what drives it?
A single-server install from the PGDG repository is mostly quick command work. The effort grows with the number of servers, the amount of standard configuration you need to repeat, and how much of the surrounding work you own: repository mirroring, storage layout, TLS, authentication rules, backup setup and monitoring. Ask any partner or internal team to break the estimate into those parts, and ask which parts repeat on every node. Your own engineers will also need time to test the result before it is trusted with production data. No duration is given here because it depends on your environment, which should be confirmed during scoping.
Can our team install PostgreSQL from PGDG on its own?
Yes, if you have Linux administrators who are comfortable with package management, systemd, file system permissions and PostgreSQL configuration. The steps are documented by the PostgreSQL project, and the harder decisions are not the install commands themselves. Your team must still decide the major version to run, how the built-in distribution module is disabled, where the data directory lives, how the service is supervised, and who receives security advisories. If those decisions have no owner, the install will work but the platform will drift.
What does a fixed-scope DeployOpen engagement cover for this work?
DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure. For a PGDG install, a fixed-scope engagement would normally be agreed in writing and could include the major version selection, repository setup, module handling, initdb and service configuration, baseline security settings, a patching procedure and handover documentation. Scope, deliverables and timelines are agreed before work starts, and a quote follows from that written scope. Ask for the exact list of servers, environments and deliverables to be stated in the agreement.
What does the work need from our side?
Plan for three inputs before any install starts. First, access: administrative access to the target hosts, the ability to reach or mirror the PGDG repository, and the cloud or data center accounts that own those hosts. Second, change windows: a restart of the PostgreSQL service is needed for initial setup and for later minor updates, so agree the windows in advance. Third, a named owner who can approve the major version, the configuration baseline and the handover. Without that owner, decisions stall and the install is left half finished.
How does patching differ from a major upgrade?
Patching means applying minor releases within the same major version. The PostgreSQL project states that minor releases never change the internal storage format, so updating means replacing executables and restarting. A major upgrade is a different job: it uses pg_dumpall and restore, pg_upgrade, or logical replication, and it needs a plan for testing, rollback and downtime. Minor releases arrive at least once every three months, so your normal OS patch tooling should include the PostgreSQL packages, but major version moves should be scheduled as projects. PostgreSQL 14 is supported until November 12, 2026, which is a reason to plan the next major version now.
Does the PostgreSQL license affect how we install it from PGDG?
The license does not change the install steps, but it does affect what you need to review. PostgreSQL is released under the PostgreSQL License, a liberal open source license similar to the BSD or MIT licenses, so you can run it without a license fee. Extensions, management tools and third-party packages you add may carry their own licenses, and those should be checked separately. Confirm the license terms of each package in your stack with your legal or procurement team, rather than assuming they match the core server.
How long should we support a PGDG install once it is running?
Support is an ongoing cost. Each major version is supported for 5 years after its initial release, and PostgreSQL 18 is supported until November 14, 2030. Your recurring work includes applying minor releases, monitoring the repository for security fixes, keeping backups and restore tests current, and planning the next major upgrade before end of life. Ask any provider whether support is a one-time handover or a retainer, and what happens to the procedures when staff change.
What DeployOpen delivers for a PGDG-based install
A written scope for a PGDG install on RHEL, Rocky or AlmaLinux hosts covers four deliverables inside your own infrastructure: the install standard, the documentation, the verification checks and the patch runbooks. The install standard fixes the repository definition, the chosen PostgreSQL major version, the disabled built-in module, the data directory layout, the systemd unit configuration and the file ownership and permissions your team will repeat on every host. The documentation records those choices and the reasons behind them, so an auditor or a new engineer can trace why the host looks the way it does. Before handover, the scope should state which checks are run on each host and what evidence they leave behind.
Verification is where a written scope earns its cost. Expect checks that confirm the server reports the expected major version, that the service starts at boot, that initdb produced a cluster with the intended data checksum setting, and that the pg_hba.conf and postgresql.conf files match the approved standard. Ask the vendor to list each check, the command that runs it and the output kept as evidence. The handover should include a patch runbook that names the minor release process, the package commands your normal tooling will call, the service restart order and the rollback steps. Confirm with your own team how the runbook fits your change control and maintenance windows, since those rules sit outside the install itself.
The install is one part of a wider PostgreSQL setup, so the scope should say where it stops. High availability, backups, connection pooling and major version upgrades are separate topics with their own decisions, and the scope should name which of them are included and which are handled by a later engagement. Ask for a written boundary before work starts, so that replication, backup tooling and major upgrade planning are not assumed to be covered by the install. DeployOpen plans and delivers these engagements as fixed scopes agreed in writing, and quotes follow from that written scope rather than from a published price list.
Where a PGDG install fits in a wider PostgreSQL plan
A PGDG install is the first building block, not the whole plan. The packages it gives you determine which major version runs on each server, so the choice you make here shapes every later step. Pick the major version against the supported dates in the PostgreSQL versioning policy, then treat the Yum repository definition, the disabled built-in module and the postgresql-<version>-server packages as a versioned baseline that your mirrors, automation and backups all reference. Record the exact major version and repository release file in your build documentation so that a later upgrade starts from a known state.
If your servers cannot reach the internet, the sibling topic on installing PostgreSQL in an air-gapped network covers mirroring the PGDG repositories. Mirror the same repository paths you configure here, and confirm that the mirror carries the minor releases you intend to apply, because the offline patch cycle depends on it. If you plan to build clusters with Ansible and Autobase, the sibling topic on that subject will expect the same package names, data directory and service unit, so keep the initdb and service steps identical across hosts. Backups come last but matter most: the continuous archiving approach described in the PostgreSQL documentation needs a base backup and archived WAL, and those paths must be set up on every node before you consider the install finished. Confirm with your backup team which tool and storage target they will use before you automate the install.
How DeployOpen scopes and supports PostgreSQL installs
DeployOpen plans and builds PostgreSQL installs from the PGDG Yum repository inside the client's own RHEL, Rocky or AlmaLinux hosts, data centers or air-gapped networks. Each engagement starts with a written scope that fixes the major version, the host standard and the handover package before any server is touched.
How we scope
- Confirm the PostgreSQL major version against the supported release dates in the versioning policy before work starts.
- Record the RHEL, Rocky or AlmaLinux release, kernel baseline and whether hosts can reach the PGDG repository directly.
- Agree in writing which servers, storage paths, service accounts and access rules the install will cover.
- Define who approves changes to the built-in module state and the patching cadence the client's team will run.
How we build
- Disable the distribution's PostgreSQL module stream and install the chosen major version from the PGDG repository.
- Initialize the data directory with
initdbunder a dedicated service account and confirm the data path permissions. - Configure the systemd unit,
pg_hba.confentry points and TLS settings to match the agreed authentication design. - Verify that a minor update can be applied through the normal package manager and service restart on a test host.
How we hand over
- A runbook covering installation steps, the repository configuration file and the exact package set installed.
- A record of the version pinning, module state and file ownership, so the client's team can reproduce the build.
- A tested checklist for applying minor releases with dnf, restarting the service and confirming the running version.
- Walkthrough sessions with the client's platform and database staff, with questions and open items logged in writing.
How we support
- Fixed-scope engagements close with the handover, and any extension is quoted as a separate written scope.
- Ongoing support, patch rounds and upgrade planning are available as a retainer, scoped to the client's hosts.
- Ask any provider to confirm which repository mirror, signing key checks and change windows they will use.
- Major upgrades are planned as their own scope, since they follow the upgrade methods in the PostgreSQL documentation.

