nordvpn

How to install PostgreSQL 11 on Debian 10 (Buster)

How to install PostgreSQL 11 on Debian 10 (Buster)

In this tutorial, I will show you How to install PostgreSQL 11 on Debian  10 (Buster). You will see the installation of  PostgreSQL 11 on Debian 10 step by step.

Before installing here is a short description of PostgreSQL

install postgresql 10 on Ubuntu

Related Post: How to install PostgreSQL 10 on Ubuntu 18.04

PostgreSQL Apt Repository

Firstly we need to add postgresql apt repository. Execute the following command it will add the repo in /etc/apt/sources.list.d/pgdg.list

Read Also: How to install PostgreSQl 11 on Debian 8

Debian 10 (Buster)

sudo bash -c "echo deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main >> /etc/apt/sources.list.d/pgdg.list"

Import the signing key

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Source: https://www.postgresql.org/download/linux/ubuntu/

Update the package lists

sudo apt-get update

See also: How to install postgresql 11 on Debian 9 (stretch)

Install Postgresql 11

Now we will install postgresql using apt-get.

sudo apt-get install postgresql-11 postgresql-contrib libpq-dev

Start and enable Services of PostgreSQL

sudo systemctl start postgresql

sudo systemctl enable postgresql

Read Also: How to install postgresql 11 on mac

PostgreSQL installation is done. If you want to use the postgreSQL log in Postgres account by typing following command

root@installvirtual:~# sudo su - postgres
postgres@ip-172-31-38-27:~$ psql
psql (11.1 (Debian 11.1-3.pgdg100+1))
Type "help" for help.
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
postgres=#

Now use the postgresql as you want to use. To get the help use the \h command.

If you have any problem using this tutorial feel free to comment below.

Leave a Reply

Your email address will not be published.


*



The reCAPTCHA verification period has expired. Please reload the page.

48-Hour Flash Sale! Courses from just $10.99