Menu

1 / 2

Installing PostgreSQL on Ubuntu 26.04

DEV Community·Aashish Chaurasiya·6 months ago
#lmkn19Bf
#create#database#postgres#linux#postgresql
Reading 0:00
15s threshold

PostgreSQL is a powerful open-source relational database known for extensibility, standards compliance, and support for advanced data types including JSON and arrays. The PostgreSQL Global Development Group maintains a dedicated APT repository with the latest releases. This guide installs PostgreSQL from the PGDG repository, secures the installation, and creates a database with a dedicated user. By the end, you'll have a hardened PostgreSQL instance with a working database ready for application use.

Install PostgreSQL

The PostgreSQL Global Development Group provides an official APT repository with the latest PostgreSQL releases.

1. Update the APT package index:

$ sudo apt update

Enter fullscreen mode

Exit fullscreen mode

2. Install the PostgreSQL common package:

$ sudo apt install postgresql-common -y

Enter fullscreen mode

Exit fullscreen mode

3. Run the repository setup script:

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

Enter fullscreen mode

Exit fullscreen mode

4.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.