The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →On Ubuntu, the standard way to install PostgreSQL is sudo apt install postgresql. It installs the version shipped with your Ubuntu release and creates a working default cluster. Canonical says the service is “automatically configured with viable defaults, but can be customised based on your specific needs” (Ubuntu Server documentation). This guide covers that route, the PostgreSQL project’s own repository for other versions, your first connection, and what remote access requires.
Which installation source should you use?
There are two real choices. The PostgreSQL project itself recommends installing through your package manager, and PostgreSQL is available in Ubuntu by default.
| Source | Use it when | Trade-off |
|---|---|---|
| Ubuntu’s own repositories | The packaged version meets your needs. This suits local development, learning, and most first setups. | The major version is fixed by your Ubuntu release. |
| PGDG APT repository (postgresql.org) | You need a different or specific major version than Ubuntu provides. | It is an extra repository to maintain. Support depends on your Ubuntu release and CPU architecture. |
Decide using three questions: does Ubuntu’s version meet your requirement, does PGDG support your release and architecture, and do you need a pinned major version?
Option 1: Install from Ubuntu’s repositories
- Refresh package lists:
sudo apt update - Install:
sudo apt install postgresql - Check the service:
systemctl status postgresql - Check the version:
psql --version
The install creates a default cluster named main, and the service starts. No further setup is needed for local use.
#1 Best Overall
Option 2: Install a specific version from PGDG
The PostgreSQL Ubuntu download page gives the current repository setup commands. It lists supported Ubuntu codenames, including jammy (22.04), noble (24.04), resolute (26.04) and stonking (26.10). Architecture availability differs by release, so check the live page for your exact combination before relying on it. Follow its steps to add the repository and refresh APT, then install a versioned package such as:
sudo apt install postgresql-18
Naming the major version, rather than the generic postgresql meta-package, keeps you on the major you chose instead of silently following a moving default.
Rank #2
Connect for the first time
Ubuntu defaults to peer authentication for local connections and scram-sha-256 for host (TCP) connections. Peer authentication maps your operating-system username to a PostgreSQL role. The installer creates a postgres superuser role, so the usual first command is:
sudo -u postgres psql
To work under your own account, create a matching role and database from that prompt (replace yourname):
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
CREATE ROLE yourname WITH LOGIN CREATEDB;
CREATE DATABASE yourname OWNER yourname;
Then psql works without sudo. Add a password later with password yourname if you need TCP logins.
Fix common first-connection errors
The Ubuntu Community Help Wiki covers these local problems.
Rank #4
- Role “yourname” does not exist: no role matches your Unix user. Create one as shown above. This is not a password problem.
- Peer authentication failed: with peer, the Unix account and the database role must match. Connect as the matching user, or use a password over TCP.
- Database “yourname” does not exist: clients default to a database named after the user, and it is not created automatically. Create it, or pass a database name with
psql -d postgres.
Where configuration lives and how clusters work
Ubuntu’s example configuration path is /etc/postgresql/<version>/main, holding postgresql.conf and pg_hba.conf. Ubuntu’s postgresql-common tooling manages clusters, each identified by version and name. According to the pg_createcluster manpage, a cluster’s start.conf decides whether systemd starts and stops it automatically, whether you control it manually, or whether service control is disabled. Most newcomers never need a second cluster.
After editing configuration, restart the service: sudo systemctl restart postgresql.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Best Value
Allow remote connections deliberately
By default only connections from the local system are allowed. Remote access needs two coordinated changes:
- In
postgresql.conf, setlisten_addressesto the specific address the server should listen on, rather than every interface. - In
pg_hba.conf, add a rule permitting a defined client network. Ubuntu’s documentation example uses ahostsslrule withscram-sha-256and a restricted network range. - Restart the service.
Ubuntu itself warns that its example is incomplete, so treat this as a separate security task. Don’t open all interfaces or all networks without understanding the exposure. Combine a narrow address range, TLS, strong passwords and a firewall rule limited to trusted clients.
Keep PostgreSQL updated
The PostgreSQL versioning policy recommends running the current minor release of your major version. Minor updates need no dump and restore, and normal apt upgrade delivers them. A major-version upgrade requires dump/reload or pg_upgrade. As of that policy page when checked in 2026, PostgreSQL 18 is supported through November 14, 2030 and PostgreSQL 17 through November 8, 2029. Check the page again when planning a long-lived deployment.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.




