How to Configure PostgreSQL 15 on Docker and Connect to it using a Database Client (DBeaver)

Опубликовано: 21 Март 2026
на канале: Briztol Tech Academy
1,577
23

In this video, we explain How to Configure PostgreSQL 15 on Docker and Connect to it using a Database Client (DBeaver). This is done on a Ubuntu 22.04 machine which is the latest Ubuntu version at the moment. However, the process is valid for all Ubuntu and Docker versions.

We assume you already have Docker on your machine. However, if you don't have Docker, you can install it using this guide - https://www.digitalocean.com/community/tut...

You can download the latest PostgreSQL version here. https://www.postgresql.org/docs/release/

After configuring Postgres with Docker, we create a database, and then we use a Database client to connect to the Postgres database. In this video, we use the DBeaver database client but the process is similar for other database clients as well.

Here is the list of commands used in the Video

Command to check installed docker version
docker -v

Command to check docker status
systemctl status docker


Docker run command to get installed postgres currently available latest version without specifyng a version
docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=testpassword postgres

Docker run command to get installed postgres version 13.2 by passing the version that we need to get configured
docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=testpassword postgres:13.2

Docker run command to get installed postgres version 15.1 by passing the version that we need to get configured
docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=testpassword postgres:15.1

Command to check details on configured docker image
docker ps -a

Login to the docker container
here postgres is the docker image name
docker exec -i -t postgres /bin/bash

Command for the user authentication. su or sudo is used to become the postgres super user
su - postgres

Command to connect to the postgresql server
psql

Command to create a postgresql database on postgresql database server 15.1
create database databse_name;
create database testdb1;

Command to grant all privileges for the created database
grant all privileges on database databse_name to postgres;
grant all privileges on database testdb1 to postgres;