How to Set Up a PostgreSQL Database with Docker

preview_player
Показать описание

Docker is a product that allows developers to create containers, which are self-contained areas on their computer for running applications. They can be used for databases, which is great if you can't install it normally (e.g. you use a Mac).

This video shows you how to set up a PostgreSQL database on Docker. It uses an existing PostgreSQL image on the Docker Hub website. You can use many different versions of PostgreSQL, not just the latest version.

You'll learn how to download and install Docker, find the right PostgreSQL image, download the image, run it, and connect to it in the DBeaver IDE. You can use any other IDE that works with PostgreSQL if you prefer.

The connection details for this image mentioned in the video are below.

Host: localhost
Port: 5432
Username: postgres
Password: whatever you specify in the "docker run" command (default is mysecretpassword)

Timestamps:
00:00 In this video
00:05 High-level steps
00:29 Download Docker
01:23 Run Docker
02:07 Create Docker Hub account
02:41 Search for PostgreSQL image on Docker Hub
03:15 Understand the docker run command
04:29 Adjust docker run command
05:19 Open Terminal and login to Docker
06:12 Download image using Docker Run
06:52 Check status using docker ps
07:19 Connect using DBeaver
07:47 Enter connection details
08:43 Run simple query
09:05 Docker Stop command
Комментарии
Автор

Such a good video and explanation, after a while I mumbled around the web, your 10 minute video got me exactly where I needed. Thank you!

ishayfrenkelYT
Автор

For all those who are getting Fatal error, password authentication error etc. Use postgres as username in the database connection dbeaver. The - - name some-name in the run command is only used to stop or resume the container it is not the login user name of the database.

imransadiq
Автор

Thank you for explaining this better, and more succinctly than my college materials 🤝 👍

amanjang
Автор

for anyone having error: FATAL: password authentication failed for user "postgres" - uninstall postgres server on your main OS, it blocks port

asfasdfsd
Автор

Near the beginning of the video, the author claimed that "some-postgres" is the name of the image and near the end, he said it's the name of the container. They are two separate things.

JeffreyMRose
Автор

I can't express how grateful I am for this video. Thank you so you have no idea how much you helped me!

jlacerd
Автор

To anyone getting this error: FATAL: password authentication failed for user "postgres"
The problem is you probably already have postgres installed in your machine, and probably running, which is using the same port docker is trying to use.

To solve this, you just need to uninstall the postgres already installed in your machine if you dont have any relevant db in it.
Docker already have postgres and some other list of databases there, like you see from the video (7:40), when you click to connect from your DBeaver, you can choose postgres from the list, and your connection should be up and running.... hopefully that helps!

easilyCoded
Автор

This is the BEST tutorial I've ever seen!!!!

rodrigobaiao
Автор

That was a really simple and instructive video. Thanks.

emirkaancati
Автор

This lesson is as sweet as Sugar. 🍬🍬Thank you for sharing

ramiworkstation
Автор

Thank you for that elaborate and concise explanation!

XenidRol
Автор

Hey thanks man, very helpful.

Also I saw your channel is dedicated to database.
I'm trying to learn database design and found not many good resources for that, probably you can take that up as video playlist?
Like given a app idea or feature idea, design a database that's efficient

sandeepgamot
Автор

Hello, could you help me I get this error > FATAL: role "postgres" does not exist ; Don't understand what I did wrong

missman
Автор

You really helped me test the connection by making the video. Thanks man

ShafiqNazrin
Автор

Thank you for this! Extremely easy given your tutorial...

MBinDenver
Автор

I love the way you explain, thanks a lot!

yusiff
Автор

I am having this error: FATAL: password authentication failed for user "some-postgres". I have tried to uninstall postgres server. I am using windows. Help, please!

dianaaycachi
Автор

This tutorial is helpful for Linux users too. Thank you.

aleksandarivanov
Автор

Excellent explanations. Thanks a lot for the clarity. From now I'm a new of your channel followers.
Thanks a lot Ben!

marioandresheviacavieres
Автор

thank you sir, in my case I was creating everything well, except for the port binding between host:container, leaving that blank

hpz