You can install PostgreSQL 19 from the official PGDG repositories with the package manager you already use. The package install itself took under a minute on every test server. The catch is that the packages don’t sit where a plain apt install or dnf install looks for them yet, so the first command on each distro is a check that tells you which repo to switch on.
Built and run in November 2026 on fresh Ubuntu 26.04.1, Debian 13, Rocky Linux 10.2 and AlmaLinux 10.2 VMs with the 19 RC2 packages, the last release candidate before the general release planned for November 19. Every output block below came from those four VMs, plus a second Ubuntu VM that started on 18 for the upgrade run.
Prepare the server
Each test VM had 2 vCPUs, 4 GB of RAM and a 20 GB disk. That is enough for a first cluster and a floor for anything real, because shared buffers, connection count and your working set decide the size of a production box, not the install. Have these ready before you begin:
- A server running Ubuntu 26.04, Debian 13, Rocky Linux 10 or AlmaLinux 10, with outbound HTTPS to
apt.postgresql.orgordownload.postgresql.org. - A user with sudo rights. Every command below runs as a normal user with
sudo. - If you kept a cluster from an earlier 19 test build, run the JSON constructor checks below first, since they decide whether that cluster upgrades. A fresh install can’t create those objects at all.
Ubuntu 24.04 and Debian 12 use the same PGDG helper, which detects the codename for you, but this run did not repeat them. If you want the current production major instead, follow the PostgreSQL 18 install on Ubuntu 26.04, because a test build has no place under an application you can’t rebuild.
Add the PGDG repository on Ubuntu and Debian
Ubuntu’s and Debian’s own archives stop well short of 19, so the packages come from apt.postgresql.org. The postgresql-common package ships a helper script that adds the repo, its signing key and the right codename in one go.
sudo apt update
sudo apt install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
The helper writes a deb822 source file rather than a one-line .list entry, and you’ll edit it in a moment. Print it to see what it chose.
cat /etc/apt/sources.list.d/pgdg.sources
On Ubuntu it pointed at the resolute-pgdg suite with only the main component. Debian 13 got trixie-pgdg on the Suites: line and no Architectures: line.
Types: deb
URIs: https://apt.postgresql.org/pub/repos/apt
Suites: resolute-pgdg
Components: main
Architectures: amd64
Signed-By: /usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg
Now ask apt whether it can see a PostgreSQL 19 package at all. Don’t skip this check, because its answer decides whether you need the next edit or can go straight to the install.
apt-cache policy postgresql-19
On both test boxes the candidate came back empty. PGDG keeps a new major in its own 19 component until the general-release packages land in main, so a stock pgdg.sources file simply can’t see it.
postgresql-19:
Installed: (none)
Candidate: (none)
Version table:
If your output shows a real version on the Candidate: line, skip ahead to the install. If it says (none), add the 19 component next to main and refresh the index, which is the method the PGDG apt FAQ gives for unreleased majors.
sudo sed -i 's/^Components: main$/Components: main 19/' /etc/apt/sources.list.d/pgdg.sources
sudo apt update
apt-cache policy postgresql-19
Ubuntu now lists three builds from resolute-pgdg/19, newest first, and Debian showed the same three with a pgdg13 suffix. PGDG keeps the older test builds in the index, so you could still install an earlier one with apt install postgresql-19=<version> while chasing a regression. You don’t need that for a normal install, because apt always takes the top line as the candidate.
postgresql-19:
Installed: (none)
Candidate: 19~rc2-1.pgdg26.04+1
Version table:
19~rc2-1.pgdg26.04+1 500
500 https://apt.postgresql.org/pub/repos/apt resolute-pgdg/19 amd64 Packages
19~rc1-1.pgdg26.04+1 500
500 https://apt.postgresql.org/pub/repos/apt resolute-pgdg/19 amd64 Packages
19~beta4-1.pgdg26.04+1 500
500 https://apt.postgresql.org/pub/repos/apt resolute-pgdg/19 amd64 Packages
Don’t skim past the version table. A ~ in a Debian version sorts below the bare number, so a 19.0 package outranks every build in that list, and a normal upgrade will move you onto it without any pinning. Here is the whole check on the Ubuntu VM, before and after the component change.

With a candidate showing on the policy line, apt has everything it needs, and the rest of the Debian family steps are ordinary package installs.
Install PostgreSQL 19 on Ubuntu 26.04 and Debian 13
You install one package. Debian packaging also creates a cluster called main and starts it, but only when the box has no other PostgreSQL cluster yet, so an upgrade box behaves differently (covered further down).
sudo apt install -y postgresql-19
It took 13.7 seconds on Ubuntu and 49.6 seconds on Debian, where postgresql-common also rebuilt its dictionaries from the installed hunspell packages. List the clusters to confirm it’s online.
pg_lsclusters
You want version 19, cluster main, port 5432 and status online. Anything other than online means the server failed to start, and the log file in the last column tells you why. A cluster on 5433 instead of 5432 means another PostgreSQL already held the default port, so check that before pointing an application at the box. Debian packaging always picks the next free port rather than failing, which is easy to miss.
Ver Cluster Port Status Owner Data directory Log file
19 main 5432 online postgres /var/lib/postgresql/19/main /var/log/postgresql/postgresql-19-main.log
Next, ask the server which build it is. Package versions and running binaries can drift apart after an update without a restart, so SELECT version() is the check that tells you later whether a minor update actually landed.
sudo -u postgres psql -c 'SELECT version();'
Ubuntu reports the PGDG package revision inside the version string, so you can match it against apt-cache policy at a glance.
PostgreSQL 19rc2 (Ubuntu 19~rc2-1.pgdg26.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit
(1 row)
The systemd unit is a template instance named after the version and cluster, postgresql@19-main. It showed active (running) right after the install, as the capture of the Ubuntu run shows.

Debian 13 behaves the same way. Its version string swaps the Ubuntu toolchain for Debian’s GCC 14, and the cluster sits in the same /var/lib/postgresql/19/main path.
PostgreSQL 19rc2 (Debian 19~rc2-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit
(1 row)
The Debian capture includes several debconf: unable to initialize frontend lines. They are harmless, because they only appear when apt runs without a terminal attached, so you won’t see them in an interactive SSH session.

For Debian specifics such as locale setup and the client-only packages, the PostgreSQL install guide for Debian covers the 18 line. Every path there carries over with 19 in place of 18.
Install PostgreSQL 19 on Rocky Linux 10 and AlmaLinux 10
The RHEL family pulls from the PGDG yum repos through a small repo RPM. Its package names start with postgresql19, so they never collide with the distro’s own postgresql packages and can sit next to them.
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-10-x86_64/pgdg-redhat-repo-latest.noarch.rpm
List the PGDG repos for 18 and 19. Every major gets a regular repo plus an updates-testing twin, and the testing ones ship disabled.
dnf repolist all | grep -E 'pgdg19|pgdg18'
On both Rocky 10.2 and AlmaLinux 10.2 the repo RPM listed these entries for the two majors. Note which ones are enabled, because the next query depends on it.
pgdg18 PostgreSQL 18 for RHEL / Rocky Linux enabled
pgdg18-debuginfo PostgreSQL 18 for RHEL / Rocky Linux disabled
pgdg18-source PostgreSQL 18 for RHEL / Rocky Linux disabled
pgdg18-updates-testing PostgreSQL 18 for RHEL / Rocky Linux disabled
pgdg18-updates-testing-debuginfo PostgreSQL 18 for RHEL / Rocky Linux disabled
pgdg18-updates-testing-source PostgreSQL 18 for RHEL / Rocky Linux disabled
pgdg19-updates-testing PostgreSQL 19 for RHEL / Rocky Linux disabled
pgdg19-updates-testing-debuginfo PostgreSQL 19 for RHEL / Rocky Linux disabled
pgdg19-updates-testing-source PostgreSQL 19 for RHEL / Rocky Linux disabled
Query for the server package with and without the testing repo. Keep the -y, because the first query against PGDG asks to import its GPG key, and a non-interactive shell would otherwise sit on that prompt forever.
sudo dnf -y repoquery postgresql19-server
sudo dnf -y repoquery --enablerepo=pgdg19-updates-testing postgresql19-server
On both VMs the plain query returned nothing and the testing query found two builds. Newest is last in this list, which is the reverse of apt.
postgresql19-server-0:19-rc1_2PGDG.rhel10.2.x86_64
postgresql19-server-0:19-rc2_1PGDG.rhel10.2.x86_64
Until the general release, PGDG publishes the server package only in pgdg19-updates-testing, so enable that repo for the install command alone. Don’t switch it on permanently with dnf config-manager, because a testing repo left enabled keeps offering test builds long after the general release, and you’d rather pick those up on purpose. If your first query already returns a build, drop the --enablerepo flag from the commands below.

RHEL packaging doesn’t initialize or start anything on its own, so the install is three steps:
- Install the server package.
- Create the data directory with the bundled
postgresql-19-setupscript. - Enable and start the
postgresql-19unit.
Run them in that order, since the unit has nothing to start until initdb has created the data directory.
sudo dnf install -y --enablerepo=pgdg19-updates-testing postgresql19-server
sudo /usr/pgsql-19/bin/postgresql-19-setup initdb
sudo systemctl enable --now postgresql-19
The install took 11.5 seconds on Rocky and 15.8 on AlmaLinux, and initdb answered with Initializing database ... OK on both. Check the build from the server.
sudo -u postgres psql -c 'SELECT version();'
PGDG’s RPM build carries no distro tag in this string, just the compiler, so it reads the same on Rocky and AlmaLinux.
PostgreSQL 19rc2 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 14.3.1 20251022 (Red Hat 14.3.1-4), 64-bit
(1 row)
SELinux stayed in enforcing mode the whole time, and PostgreSQL started without a boolean or a relabel. If your security team audits process domains, know that the PGDG binary under /usr/pgsql-19 is labelled bin_t, so the server runs as unconfined_service_t rather than postgresql_t, while the data directory still gets postgresql_db_t. A side check on Rocky showed PGDG’s 18 build behaves exactly the same, so this comes from the PGDG layout on EL10 and is not new in 19.

The repo RPM, package names and service name are identical on Rocky Linux and AlmaLinux, so one set of commands covers both. If you still run the 17 line on this family, the PostgreSQL 17 guide for Rocky and AlmaLinux 10 uses the same repo RPM.
Check the new defaults
A handful of defaults moved in this major. A fresh cluster is the cheapest place to see them, because the same values will apply to every cluster you upgrade unless its postgresql.conf overrides them.
sudo -u postgres psql -c "SELECT name, setting FROM pg_settings WHERE name IN ('jit','default_toast_compression','max_locks_per_transaction','io_method','data_checksums','password_encryption') ORDER BY name;"
The Ubuntu cluster came up with these values. Checksums, io_method = worker and SCRAM passwords were already the defaults in 18, so the lines worth reading are the other three.
name | setting
---------------------------+---------------
data_checksums | on
default_toast_compression | lz4
io_method | worker
jit | off
max_locks_per_transaction | 128
password_encryption | scram-sha-256
(6 rows)
Three of these differ from 18. TOAST compression moved from pglz to lz4, JIT is now off unless you turn it on, and max_locks_per_transaction doubled to 128. JIT is the one that bites, because analytic queries that leaned on it lose it silently after an upgrade, so time your heaviest reports before and after and set jit = on again if they slow down. The lock default looks bigger but holds about the same capacity, since lock size allocation changed too. The full list of changes, with tested SQL for each feature, is in the PostgreSQL 19 new features walkthrough.
Drop JSON_ARRAY and JSON_OBJECT objects from test clusters
Earlier 19 test builds accepted JSON_ARRAY() and JSON_OBJECT() over arrays, composite types and range types in places that need an immutable expression. The PostgreSQL release announcement reverts that, because indexes built on them could go stale. The revert covers three kinds of object:
- Expression indexes.
- Generated columns.
- Partition keys.
The same announcement warns that pg_dump, pg_restore and pg_upgrade will fail to recreate such objects. So if you kept a cluster from an earlier test build, drop or redefine them before you move it anywhere, or the move breaks halfway. Run these three queries in every database of that cluster.
SELECT indexrelid::regclass AS index_name FROM pg_index WHERE pg_get_indexdef(indexrelid) ~* 'json_(array|object)\(';
SELECT attrelid::regclass AS table_name, attname FROM pg_attribute a JOIN pg_attrdef d ON d.adrelid = a.attrelid AND d.adnum = a.attnum WHERE a.attgenerated <> '' AND pg_get_expr(d.adbin, d.adrelid) ~* 'json_(array|object)\(';
SELECT partrelid::regclass AS table_name FROM pg_partitioned_table WHERE pg_get_partkeydef(partrelid) ~* 'json_(array|object)\(';
The index query matches any JSON constructor, including the scalar ones that are still legal, so read each hit before dropping it. On the lab cluster it found two scalar test indexes, JSON_ARRAY(id)::text and JSON_ARRAY(id)::jsonb, which are legal and stay, and the other two queries came back with (0 rows).
index_name
------------------------
t_json_json_array_idx
t_json_json_array_idx1
(2 rows)
An empty result on all three means the cluster is safe to dump or upgrade. A row from the generated-column or partition query means you rebuild that table with a different expression first, and an index hit over an array or composite column just needs a DROP INDEX.
ERROR: functions in index expression must be marked IMMUTABLE
On the current packages the revert shows up as an immutability error the moment you try to create one of these objects. The lab table had a text[] column, and all three object types failed against it.
sudo -u postgres psql -c "CREATE TABLE t_json (id int PRIMARY KEY, tags text[], p point);"
sudo -u postgres psql -c "CREATE INDEX ON t_json ((JSON_ARRAY(tags)));"
sudo -u postgres psql -c "ALTER TABLE t_json ADD COLUMN j json GENERATED ALWAYS AS (JSON_OBJECT('tags': tags)) STORED;"
sudo -u postgres psql -c "CREATE TABLE t_part (tags text[]) PARTITION BY LIST ((JSON_ARRAY(tags)::text));"
The table is created, then the index is refused, followed by the generated column and the partition key with their own wording. Search your migration logs for all three strings, because an ORM may have swallowed them.
ERROR: functions in index expression must be marked IMMUTABLE
LINE 1: CREATE INDEX ON t_json ((JSON_ARRAY(tags)));
^
ERROR: generation expression is not immutable
ERROR: functions in partition key expression must be marked IMMUTABLE
Scalar arguments still work. JSON_ARRAY(id) over an int column only failed because json has no btree operator class, and casting the result to text or jsonb created the index fine. If an application needs this kind of index, index a jsonb cast over scalar columns instead.

The PGDG apt FAQ adds a broader warning for test builds. Data formats can change between them, so take a pg_dump before moving a test cluster to a newer build, even one that looks like a small step.
Upgrade an 18 cluster with pg_upgradecluster
On Ubuntu and Debian, 18 and 19 install side by side, and pg_upgradecluster from postgresql-common wraps pg_upgrade with the port and config shuffling done for you. The lab started from a box with 18 already running, an appdb database holding a 50,000-row table and a pg_trgm GIN index on it.
Ver Cluster Port Status Owner Data directory Log file
18 main 5432 online postgres /var/lib/postgresql/18/main /var/log/postgresql/postgresql-18-main.log
Add the 19 component and install the package exactly as in the install section. On the lab boxes apt pulled in postgresql-19-jit as a recommended package, matching the postgresql-18-jit already there. If you install with --no-install-recommends, name postgresql-19-jit yourself, because the features walkthrough found that pg_upgradecluster refuses to start without it.
sudo sed -i 's/^Components: main$/Components: main 19/' /etc/apt/sources.list.d/pgdg.sources
sudo apt update
sudo apt install -y postgresql-19
pg_lsclusters
Because an 18 cluster already existed, packaging didn’t create an empty 19 main, and pg_lsclusters still listed only 18. That is the state you want. If you do see an empty 19 main, for example from an earlier install, remove it with sudo pg_dropcluster 19 main --stop first, or the upgrade refuses to create its target. Then run the upgrade in pg_upgrade mode, which skips the default dump and restore.
sudo pg_upgradecluster -m upgrade 18 main
It finished in about 10 seconds on 50,000 rows. Plain -m upgrade runs pg_upgrade in copy mode, so it copies the data files into the new cluster: time grows with data size, and you need free disk about the size of the old cluster. -m link skips the copy, but once 19 starts on linked files the old cluster is no longer a safe rollback. -m clone keeps 18 intact and needs a reflink filesystem such as Btrfs or XFS with both data directories on it. It then ran vacuumdb over each database and swapped the ports, so the new cluster keeps 5432.
Success. Please check that the upgraded cluster works. If it does,
you can remove the old cluster with
pg_dropcluster 18 main
Ver Cluster Port Status Owner Data directory Log file
18 main 5433 down postgres /var/lib/postgresql/18/main /var/log/postgresql/postgresql-18-main.log
Ver Cluster Port Status Owner Data directory Log file
19 main 5432 online postgres /var/lib/postgresql/19/main /var/log/postgresql/postgresql-19-main.log
Your applications keep connecting to 5432 and land on 19. The old cluster stays on disk, stopped, and that copy is your rollback path, so leave it alone until the data checks out.
sudo -u postgres psql -d appdb -c "SELECT count(*), version() FROM orders;"
All 50,000 rows answered from the new server, and the version column proves the query hit 19 rather than a cluster left on the old port. Run the same kind of count against your biggest tables, because a row count is cheap and catches a wrong-cluster mistake before you delete anything.
count | version
-------+---------------------------------------------------------------------------------------------------------------------------------
50000 | PostgreSQL 19rc2 (Ubuntu 19~rc2-1.pgdg26.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 15.2.0-16ubuntu1) 15.2.0, 64-bit
(1 row)
The release notes’ migration section says indexes built on full text search, pg_trgm or fuzzystrmatch may need a rebuild after pg_upgrade. Reindex those before you drop the old cluster, because once 18 is gone a bad index has no fallback. The same section says pg_upgrade now refuses clusters with btree_gist indexes on inet or cidr columns, so drop those on 18 (they often sit behind exclusion constraints) and recreate them on 19 after the upgrade.
sudo -u postgres psql -d appdb -c "REINDEX INDEX orders_trgm;"
sudo pg_dropcluster 18 main
The capture covers the full run, from the upgrade through the reindex to the closing pg_lsclusters with only 19 left.

Rocky and AlmaLinux have no pg_upgradecluster, so the RHEL path runs pg_upgrade by hand against /var/lib/pgsql/18/data and /var/lib/pgsql/19/data. The major version upgrade guide walks through that on Rocky Linux, and the same steps apply with 19 as the target.
Allow remote connections
A new cluster listens on localhost only, which is the safe default. Opening it takes three changes, and skipping any one leaves clients timing out or refused:
- Set
listen_addressesso the server binds to the network. - Add a client rule to
pg_hba.confand restart. - Open port 5432 in the host firewall.
ALTER SYSTEM handles the first change without opening a config file, and it works the same on both families.
sudo -u postgres psql -c "ALTER SYSTEM SET listen_addresses = '*';"
On Ubuntu and Debian the access file lives under /etc/postgresql/19/main/. Append a rule for your client subnet, changing 10.0.1.0/24 to yours, then restart the cluster and look at the socket.
echo 'host all all 10.0.1.0/24 scram-sha-256' | sudo tee -a /etc/postgresql/19/main/pg_hba.conf
sudo systemctl restart postgresql@19-main
sudo ss -tlnp | grep 5432
The socket should now be bound to every IPv4 and IPv6 address instead of 127.0.0.1. If it still shows the loopback address, the restart didn’t happen and the ALTER SYSTEM value is still waiting in postgresql.auto.conf.
LISTEN 0 200 0.0.0.0:5432 0.0.0.0:* users:(("postgres",pid=11723,fd=6))
LISTEN 0 200 [::]:5432 [::]:* users:(("postgres",pid=11723,fd=7))
Ubuntu ships ufw inactive, and Debian has it after an apt install ufw. The rule below only takes effect once ufw is enabled, and if you enable it now, run sudo ufw allow OpenSSH first so you don’t lock yourself out. On a cloud VM, open 5432 in the provider’s security group too.
sudo ufw allow 5432/tcp
On Rocky and AlmaLinux the access file sits inside the data directory and the unit has a different name. firewalld already ships a postgresql service definition, so there’s no port number to remember, and the rule survives a reboot because of --permanent.
echo 'host all all 10.0.1.0/24 scram-sha-256' | sudo tee -a /var/lib/pgsql/19/data/pg_hba.conf
sudo systemctl restart postgresql-19
sudo firewall-cmd --add-service=postgresql --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-services
Both firewall commands answered success on the Rocky VM, and --list-services included postgresql. You’ll also see the same two wildcard sockets in ss as on Ubuntu. Clients on that subnet can now log in with a password, and nobody else gets past the pg_hba.conf check. Set a password on the role you connect with before testing from another machine, because the postgres role has none by default and the scram-sha-256 rule will reject it.
Keep PostgreSQL 19 updated
Minor releases arrive through the same repos you just set up, so updating is a normal package upgrade plus a restart. On Ubuntu and Debian, list what’s pending first.
apt list --upgradable 2>/dev/null | grep -i postgres
On the test box only the PGDG build of postgresql-common was waiting, replacing the older one from the Ubuntu archive. No newer 19 server build existed yet. Let that one through, because PGDG’s postgresql-common tracks new majors and cluster tools ahead of the distro copy, and a stale one is the usual reason pg_upgradecluster or pg_createcluster behaves differently from the docs.
postgresql-client-common/resolute-pgdg 294.pgdg26.04+2 all [upgradable from: 290ubuntu1]
postgresql-common/resolute-pgdg 294.pgdg26.04+2 all [upgradable from: 290ubuntu1]
Upgrade only the PostgreSQL packages when you want a controlled window. Restart the cluster afterwards, because the old binary keeps running until you do, then confirm the new build with SELECT version().
sudo apt install --only-upgrade -y postgresql-19 postgresql-common
sudo systemctl restart postgresql@19-main
On Rocky and AlmaLinux, check against the same repo you installed from. An exit code of 0 means nothing newer is published, and 100 means updates are waiting.
dnf check-update -y --enablerepo=pgdg19-updates-testing 'postgresql19*'; echo exit=$?
The lab box printed exit=0. The regular pgdg19 repo should arrive with a newer pgdg-redhat-repo package, so once general-release packages are out, run sudo dnf upgrade pgdg-redhat-repo first. After that, a plain sudo dnf upgrade 'postgresql19*' followed by sudo systemctl restart postgresql-19 does the job without the extra flag. Minor releases sometimes come with post-update steps such as indexes to rebuild, so read the release announcement before you restart.
Find PostgreSQL 19 files on each distro
The two package families put things in different places, and most “where’s my config” questions come down to this table. Every path was read off the lab VMs.
| Item | Ubuntu 26.04 / Debian 13 | Rocky Linux 10 / AlmaLinux 10 |
|---|---|---|
| Server package | postgresql-19 | postgresql19-server |
| Repo holding 19 | 19 component of PGDG apt | pgdg19-updates-testing, then pgdg19 |
| Cluster created on install | Yes, 19 main, if no other cluster exists | No, run postgresql-19-setup initdb |
| Service | postgresql@19-main | postgresql-19 |
| Data directory | /var/lib/postgresql/19/main | /var/lib/pgsql/19/data |
| pg_hba.conf | /etc/postgresql/19/main/ | /var/lib/pgsql/19/data/ |
| Binaries | /usr/lib/postgresql/19/bin | /usr/pgsql-19/bin |
| Major upgrade tool | pg_upgradecluster -m upgrade | pg_upgrade by hand |
| Firewall | ufw allow 5432/tcp | firewall-cmd --add-service=postgresql |
Once the cluster holds data you care about, put point-in-time recovery under it before anything else, because a single node with no WAL archive is one bad disk away from a restore that doesn’t exist. When one node isn’t enough, the Patroni, etcd and HAProxy cluster guide is the next build.