How To Install PostgreSQL

How to install and configure the PostgreSQL server in Ubuntu. This is an open-source relational database management system and it’s designed to handle workloads, from a single machine to data warehouses. In a similar way, we can configure and install PostgreSQL on Linux as well as ubuntu.

We don’t need to add any repository to install the database. we have to update the packages and simply run the below commands to get installed. 

Check Out: How To Set Java Heap Size On Tomcat Server Linux

if you want to update the machine before installing the PostgreSQL, you can use sudo apt update command.

Install the PostgreSQL using apt install postgresql postgresql-contrib postgresql-client-common

The service will start automatically we can check using netstat -tnlp

Check Out: How To Install Java Using Apt-Get Command In Ubuntu

The PostgreSQL must be listening on port 5432. s

We can check the version installed using apt show postgresql

sudo -u postgres psql -c "SELECT version();"

postgresql client install ubuntu

Check Out: Enable and Disable Journaling On EXT4 File Systems In Linux

We can also check the service running with service postgresql status so

postgresql ubuntu install

By default, user postgres will be created on the machine and we can log in using the below commands. so

su - postgres

install postgresql linux

Check Out: How To Secure Apache Web With Server Hardening In Linux

you can exit using \q and check the database using \l

configure postgresql ubuntu

Check user using \du so

postgresql install in ubuntu

That’s it.


Please enter your comment!
Please enter your name here