A platform-independent object-relational database management system is called Postgres (ORDBMS). The database management system is a common component of Linux distributions. Additionally, Windows and macOS computers support its use. The DBMS is suitable for data warehouse databases due to object relationality. In contrast to relational database management systems like MySQL, it allows for the relational storage of complex data items in the database. Postgres utilizes a client-server architecture. The server is in charge of overseeing the databases, processing client requests, and responding to them. A client software with a graphical user interface is often included in Linux distributions in addition to the server and a command line-based client. In a distributed architecture, client and server communication occurs across a TCP/IP connection. We mentioned below are the steps to install PostgreSQL 13 on Ubuntu 22.04 LTS Linux.

Steps to install PostgreSQL 13 on Ubuntu 22.04 LTS Linux

Update Ubuntu system

Step 1: We always work on a latest release of OS to make sure there are no old dependency issues. Login to your Ubuntu server and run the following commands to update all the packages installed. Step 2: Once the system has been updated, We recommend you perform a reboot to get the new kernel running incase it was updated.

Add PostgreSQL 13 repository to Ubuntu 22.04|20.04|18.04

Step 1: Install required dependency packages Step 2: Now that we have updated and rebooted our system, let’s add the APT repository required to pull the packages form the PostgreSQL repository. Step 3: After importing GPG key, add repository contents to your Ubuntu 22.04|20.04|18.04 system: Step 4: The repository added contains many different packages including third party addons. They include:

Install PostgreSQL 13 on Ubuntu 22.04|20.04|18.04

Step 1: With the repository added we can install the PostgreSQL 13 packages on our Ubuntu 22.04|20.04|18.04 Linux server. But first update the package index for the version to be available at the OS level. Step 2: The run the commands below to install PostgreSQL 13 on Ubuntu 22.04|20.04|18.04 Linux system.

Test PostgreSQL Connection

Step 1: During installation, a postgres user is created automatically. This user has full superadmin access to your entire PostgreSQL instance. Before you switch to this account, your logged in system user should have sudo privileges. Step 2: Let’s reset this user password to a strong Password we can remember. Step 3: Start PostgreSQL prompt by using the command: Step 4: Get connection details like below. Step 5: You are connected to database “postgres” as user “postgres” via socket in “/var/run/postgresql” at port “5432”.Let’s create a test database and user to see if it’s working. postgres=# conninfo Step 6: Connect to database: Step 7: Other PostgreSQL utilities installed such as createuser and createdb can be used to create database and users. Step 8: We can create and connect to a database on PostgreSQL server.

Configure remote Connection

Ubuntu’s PostgreSQL 13 installation only allows connections from localhost. Ideally, distant clients would connect to a central database server in a production environment, but only over a private network (LAN). Step 1: To enable remote connections, edit PostgreSQL configuration file: Step 2: Uncomment line 59 and change the Listen address to accept connections within your networks. Step 3: Also set PostgreSQL to accept remote connections from allowed hosts.

Listen on specified private IP addresslisten_addresses = ‘192.168.10.11’

Step 4: After the change, restart postgresql service.

Accept from anywherehost all all 0.0.0.0/0 md5

Accept from trusted subnethost all all 10.10.10.0/24 md5

Final Words

We hope you like our article on how to install PostgreSQL 13 on Ubuntu 22.04 LTS Linux. Information is stored and retrieved using PostgreSQL, an extremely potent object-relational database management system written in C and C++. A highly compliant and adaptable database, PostgreSQL can manage numerous processes concurrently. PostgreSQL 13 is a significant improvement. PostgreSQL has seen a lot of notable performance upgrades, substantial security updates, and outstanding feature additions that have made using, administering, and working with it even more impressive.

How to install PostgreSQL 13 on Ubuntu 22 04 LTS - 25How to install PostgreSQL 13 on Ubuntu 22 04 LTS - 72How to install PostgreSQL 13 on Ubuntu 22 04 LTS - 23How to install PostgreSQL 13 on Ubuntu 22 04 LTS - 63