How to install PostgreSQL 13 on Debian 10.x step by step

In this article, we will see how to install PostgreSQL 13 on Debian 10.x step by step. PostgreSQL is available in all Debian versions by default.

Steps to install PostgreSQL 13 on Debian 10.x

1. Create the file repository configuration.

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

2. Import the repository signing key.

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

3. Update the package lists.

sudo apt-get update

How to install PostgreSQL 13 on Debian 10.x step by step

4. Install PostgreSQL 13 on Debian 10.x versions using below command.

sudo apt-get -y install postgresql-13

5. Check the PostgreSQL server on Debian status by using following command.

systemctl status postgresql

6. Lets connect to PostgreSQL server using.

sudo su - postgres

7. Change the postgres user password on Debian Linux

alter user postgres with password 'aasasa@14232';

So, in this article we have seen how to install PostgreSQL 13 on Debian 10 version step by step.