How to create a docker-compose setup with PostgreSQL and pgAdmin4

Поділитися
Вставка
  • Опубліковано 22 січ 2025

КОМЕНТАРІ • 59

  • @bethuelthipe-moukangwe7786
    @bethuelthipe-moukangwe7786 2 місяці тому +1

    Thanks for the assisting me to connect my PGadmin with Postgres in Docker container. It was a big challenge for me.

  • @danieltorres6583
    @danieltorres6583 8 місяців тому +1

    Whenever I have to see how to connect pgadmin to my containers I always return to this tutorial, thank you very much

    • @Randomcode_0
      @Randomcode_0  7 місяців тому +1

      Glad to hear that!!

    • @Orhani-qs6ok
      @Orhani-qs6ok 3 місяці тому +1

      So true bro, I've always used this guide - Saved my live multiple times. We love you Random Code !!!!!

  • @Akhmad_Dag
    @Akhmad_Dag 6 місяців тому

    My brother, thank you very much for your help. I couldn't find the information I needed all over the Internet. You helped me

  • @viktorojems
    @viktorojems Рік тому +4

    Thank you very much for this, you saved a life

  • @sandeepjavastudio
    @sandeepjavastudio 5 місяців тому

    Thank you so much for this tutorial, I saw lot of the other tutorials but this one really helped me to solve the problem.

  • @abdulqahar1168
    @abdulqahar1168 Рік тому +4

    Works well, thank you for your time and effort.

  • @ChrisB-hd9lv
    @ChrisB-hd9lv 2 місяці тому

    Thank you for this video. I tried troubleshooting via Chat GPT and Stackoverflow, but how do I get past this error at 4:40 when I click Save: unable to connect to server: connection failed: connection to server at , port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?

  • @fikretakbass
    @fikretakbass 20 днів тому

    GOD BLESS AND PROTECT YOU FROM ALL HACKERS BRO.!!!!

  • @sanchessantos7153
    @sanchessantos7153 5 місяців тому

    Thanks my friend, excellent tutorial, hello from Brazil :)

  • @dthacker9
    @dthacker9 2 місяці тому

    Thank you! The PostgreSQL and Pg Admin are up. The "version" line of the docker-compose.yml file seems to have been deprecated.

    • @Randomcode_0
      @Randomcode_0  2 місяці тому

      You are very much right, the version line is no longer needed in newer versions, but it won't break if you still include it.

  • @StudyStreamPlus
    @StudyStreamPlus Рік тому +1

    Thank you for this. Worked first time. I don't like the idea of having an additional container just for a database GUI, however it is simpler than modifying the postgres config on build to dynamically add a host ip.
    Do you know how we can persist the connection in pgAdmin so we don't have to set it up every time?

  • @saifulanwar4394
    @saifulanwar4394 Рік тому +2

    what version above? compose version?

  • @ricardo072
    @ricardo072 Рік тому

    May I ask if you can have a similar docker compose demo using postgreSQL and Liquibase ?

  • @henoknigatu7121
    @henoknigatu7121 7 місяців тому

    👍very helpful video...but the ipaddress for the postgres db is not static when i restart the container it changes, is there any way i can fix this, i wanted my locally deployed webapp to access the db when ever i start my server.

  • @tecnopadre
    @tecnopadre 3 місяці тому

    saved my life, thank you

    • @Randomcode_0
      @Randomcode_0  3 місяці тому +1

      Thank you so much! I’m really glad to hear that I was able to save your life :)

  • @WorldKris
    @WorldKris Рік тому +1

    Hi. Thank you so much for the guide! If I may ask, how did you end up typing that "version:3.8"? Should I input the same line of code as well if I'm going to install PostgreSQL and Pgadmin4 via Docker as of the time of this writing?

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      The newer versions of Docker Compose no longer need this line, and I think everything should work the same without it.

    • @WorldKris
      @WorldKris Рік тому

      @@Randomcode_0 thank you for the insight :)!

  • @nghiapham7651
    @nghiapham7651 7 місяців тому

    u save my life bro

  • @daedae9368
    @daedae9368 11 місяців тому

    Thank you for this!

  • @Maximilian.R.L
    @Maximilian.R.L Рік тому

    Does the host or other container running web server? I cannot connect to either service pgadmin-client or browser from other device

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      Docker running locally is only accessible from your own machine on localhost. If you want something to be publicly available, the simplest way is to use a cloud hosting provider like AWS or Google Cloud.

  • @HriSri
    @HriSri 10 місяців тому

    thanks this is exactly what i wanted to use

  • @valdosot
    @valdosot 5 місяців тому

    Thanks a lot!!!!!. It works perfectly.

  • @alaatahraoui4655
    @alaatahraoui4655 Рік тому

    thank you for the explanation and the video, pls i have some questions:
    1- why do we use the ip of the container while we can use our host machit ip adresse?
    2- does the ip adresse of the container fixed or it can be changed?
    Thank you in advance.

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      1. How we can access our container depends on our position. From the same docker network we can just use the container name. From our local machine where we port forward an open port from our container we need to use localhost and the port.
      2. It depends on your setup. But as far as I remember it will not always stay the same.
      3. You might be right in the assumption that it will work with a container name instead of IP in this case, let me know if you test it.

    • @alaatahraoui4655
      @alaatahraoui4655 Рік тому

      thank you for your answer. I tried with the name of the container (postgres_container) in pgAdmin and it works with no problem@@Randomcode_0

  • @minhthanhle1223
    @minhthanhle1223 8 місяців тому +1

    godbless to you sir

  • @mahikumar8813
    @mahikumar8813 4 місяці тому

    1. How does my pgadmin and postgres communicate even without specifying network? this is absurd!
    2. How come data is stored and volumes are implicitly created for postgres?

  • @jasminedaniels4790
    @jasminedaniels4790 4 місяці тому

    While I love this tutorial, I was wondering why after I previously set this up, then close the container (docker-compose down) , and then come back with docker-compose up, it didn't save my server or any tables I previously created?

    • @jasminedaniels4790
      @jasminedaniels4790 4 місяці тому

      Ah! I see, data persists as long as the container is running, duh! Lol I have to leave the container running, but you can sign out and sign in as much as you want I guess, sorry, I'm a novice.

    • @Randomcode_0
      @Randomcode_0  4 місяці тому

      No problem at all! You're right-data persists as long as the container is running, so you'll need to keep it up to retain your server and tables. Feel free to sign out and in as needed, and don't hesitate to ask more questions!

  • @mikehynz
    @mikehynz Рік тому

    I'm new to PG and actually SQL in general in the middle of some courses (for clarity). I really would like to use a Docker setup PG, will this be similar on mac osx?

    • @Randomcode_0
      @Randomcode_0  Рік тому +1

      Yes, the process should be similar on macOS as well. You can follow the same steps in the tutorial to set up PGAdmin in a Docker container on macOS. Good luck with your courses!

    • @mikehynz
      @mikehynz Рік тому

      @@Randomcode_0 Thanks for the help! Worked great!

  • @ooogabooga5111
    @ooogabooga5111 2 місяці тому

    for me using the gateway IP address did the trick.

  • @kresimircosic3753
    @kresimircosic3753 Рік тому +1

    I don't have the IP address filled at all, just an empty string "".
    EDIT: NVM it wasn't started at all for some reason.

  • @Bryan-xp4nv
    @Bryan-xp4nv Рік тому

    🔥🔥🔥

  • @vasilnadiradze8638
    @vasilnadiradze8638 Рік тому

    thank you

  • @diegoslinger1254
    @diegoslinger1254 2 місяці тому

    Good

  • @marioandresheviacavieres1923

    Thanks

  • @ji156_
    @ji156_ Рік тому

    thanks :)

  • @fabiovalinhos
    @fabiovalinhos 9 місяців тому

    save me. thanks man

  • @ronsreacts
    @ronsreacts 10 місяців тому

    Today i got to know to be intelligent, you first need to be a foolish.

  • @uttamdutta1762
    @uttamdutta1762 Місяць тому

    Tried. Woks !!
    Thanks