Page cover

1.2.3 - Connecting pgAdmin and Postgres

Last updated Jan 19, 2025

β›” I recommend not pausing your workflow once you docker run -it in this video

Youtube Video | ~10 min

https://www.youtube.com/watch?v=hCAIVe9N0ow&list=PL3MmuxUbc_hJed7dXYoJw8DoCuVHhGEQb&index=7&pp=iAQB

✍️ In this video we will talk about using pgAdmin to manage our Postgres in Docker. We will learn about creating a network to connect our containers. Then, we get to take a look at the front end of our work and we will create a new server on pgAdmin to host our taxi dataset.

πŸ‘€ Note that in 1.2.5 we will be using docker-compose in a yaml file method instead

pgAdmin

"pgAdmin is an open-source, web-based graphical user interface (GUI) tool primarily used to manage and administer PostgreSQL databases, allowing users to perform tasks like creating databases, tables, users, and executing SQL queries through a visual interface rather than just command-line commands; essentially, it's the primary management tool for PostgreSQL databases." - AI

Running pgAdmin & Postgres together

◼️ To connect the two, we need to create a network

"Container networking refers to the ability for containers to connect to and communicate with each other, or to non-Docker workloads."

Then we want to add the network and network name to our docker run command for both containers

βœ… You should now be able to get to and log in to the front end at http://localhost:8080/

If you stop your docker container at any point, go to your docker desktop to restart it. You can also get to your Port(s) by clicking on them here - such as 8080:80


Create New Server

Make sure your container is running and head to http://localhost:8080/. After entering the username and password as discussed above, we will want to add a 'Server'

βš’οΈ The UI for PgAdmin 4 has changed. Right click on 'Servers', Click 'Register', Click 'Server'.

General Tab - Name = 'Docker Localhost'

βœ… Now we should have a new server in local host 8080 that is connected to our dataset in 5432

Resources

View the above docker run commands in my github repo

Not found

πŸ“š Docker networking

πŸ“š Where we are heading

Last updated