Connection refused postgres pgadmin

Hello

I dockerized the postgres and pgadmin but I cannot connect to my postgres with pgadmin even due I can connect to it through my NodeJS app. What did I mess? Any config, env, or …

my docker-compose is here: docker/docker-compose-files/postgres-pgadmin at docker-compose · kasir-barati/docker · GitHub

Thank you for your though on this.

Good morning,
to little information provided :slight_smile:
which hostname/ip-address do you use for connecting from pgadmin to postgres? Is there a difference between you NodeJS-application and pgadmin (especially the network the container is in)? Is there any errormessage?
As connection to postgres is possible from NodeJS there seems to be no general problem with postgres (i.e. wrong credentials or postgres-container not running).

1 Like

I solved this issue by entering service name that I wrote in my docker-compose file instead of localhost. So here are what you need to do:

  1. Add New Server
  2. Give it a name (It can be anything)
  3. Go to the second tab (Connection)
  4. Enter your service name in the “Host name/address” text box.
  5. Now enter your POSGRES_PASSWORD as the “Maintenance database” and POSGRES_DB as the “Passwrod” and POSTGRES_USER as the “Username”

Now you should be able to connect to your DB.