Install PostgreSQL 18 on Ubuntu 25.10

3 days ago 3

How-to guide for installing PostgreSQL version 18 on Ubuntu, after a fresh installation of version 25.10 (Questing Quokka).

© 2025 Paolo Melchiorre “Morning view from © 2025 Paolo Melchiorre “Morning view from "Ponte del Mare" showing a fishing boat leaving the Pescara (Italy) harbor towards the Adriatic Sea at sunrise.”

Ubuntu 25.10 ships with PostgreSQL 17 by default, but if you want to try the latest features available in PostgreSQL 18, you can install it directly from the official PostgreSQL APT repository.

PostgreSQL 18 brings performance improvements with its new I/O subsystem, better index usage, and new developer features like virtual generated columns and the uuidv7() function.

This guide shows the quickest and cleanest way to install it.

TL;DR

After a fresh installation of Ubuntu 25.10 (Questing Quokka):

$ sudo apt install --yes postgresql-client-common $ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh $ sudo apt install --yes postgresql-18

Goal

This article is for developers who have just installed Ubuntu 25.10 and want to use PostgreSQL 18 instead of the version provided by Ubuntu packages.

Ubuntu 25.10 includes PostgreSQL 17 in its default repositories. If you prefer to install the latest PostgreSQL release, version 18, you can use the official APT repository maintained by the PostgreSQL Global Development Group (PGDG).

The PostgreSQL Global Development Group (PGDG) maintains an APT repository of PostgreSQL packages for Debian and Ubuntu. Using this repository you can install and keep PostgreSQL updated independently from the version provided by Ubuntu. This way you will have only one PostgreSQL installation on your system, the official one from PGDG.

For more details, see the PostgreSQL downlaod documentation.

Install PostgreSQL 18

First, install the postgresql-client-common package. It provides the script needed to configure the PGDG APT repository.

$ sudo apt install --yes postgresql-client-common

Then, run the setup script provided by PostgreSQL to add the official PGDG repository for Debian and Ubuntu systems.

$ sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh

The script adds the correct repository for your Ubuntu release (in this case questing-quokka) and imports the repository signing key.

Now you can install PostgreSQL 18 from the PGDG repository.

$ sudo apt install --yes postgresql-18

After installation, the PostgreSQL service starts automatically. You can check the installed version with:

and connect to the server with:

At this point, PostgreSQL 18 is installed and running on Ubuntu 25.10 using the official PGDG repository.

Disclaimer

There is no warranty for the program, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the program “as is” without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the program is with you. Should the program prove defective, you assume the cost of all necessary servicing, repair or correction.

Read Entire Article