0

I've PostgreSQL 9.6 docker container. Running on port 32768. I try to connect the server to pgadmin4 its shown following error.

In pgAdmin4: enter image description here

Docker container: enter image description here

In /etc/postgresql/9.6/main/postgresql.conf i added the following line

listen_addresses='*'

In /etc/postgresql/9.6/main/pg_hba.conf: enter image description here

6
  • Have you tried to look up the ip adress of the docker container? docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id
    – Jakob
    Feb 4, 2018 at 8:42
  • Ya @Jakob I tried with DB container IP also it's not connecting. While doing telnet localhost 32768 its showing Connected to localhost if I use container IP shown as telnet: Unable to connect to remote host: Connection refused i tried this outside docker.
    – Gokul P
    Feb 4, 2018 at 12:59
  • Are you able to connect using psql?
    – Murtuza Z
    Feb 5, 2018 at 5:19
  • I have the same problem and I'm able to connect with psql. My web application running in localhost also connects to the database. May 8, 2019 at 7:17
  • 1
    Thanks @Gokulp, but I've already done that and it didn't work... But I've got a satisfactory set up using docker-compose May 27, 2019 at 8:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.