Reputation: 1
I am trying to access the PgAdmin web interface running in a Docker container, but I keep getting the error:
"This site can’t be reached. The connection was reset."
Docker Engine: Integrated with WSL 2 on Windows using Hyper-V
PgAdmin Container: Running with the following configuration:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b3d84fe03656 dpage/pgadmin4 "/entrypoint.sh" 30 minutes ago Up 30 minutes 443/tcp, 0.0.0.0:5050->80/tcp, [::]:5050->80/tcp pgadmin
b55addacc28d postgres "docker-entrypoint.s…" 4 days ago Up 2 hours 0.0.0.0:5432->5432/tcp, :::5432->5432/tcp java_postgres_
Why is the PgAdmin web interface not accessible from the host machine? Are there any additional configurations required to expose the web interface properly? Should I change the network mode or manually set an IP for PgAdmin?
Any help is appreciated! 🚀
I entered the PgAdmin container and ran ip addr show, which gave me:
~$ hostname -I
192.168.1.54
169.254.73.153
172.17.0.1
172.20.0.1
172.19.0.1
172.18.0.1
~$ hostname -i
127.0.1.1
9: eth0@if10: \<BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN\> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:03 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
Opened the browser and entered http://192.168.1.54:5050 (my local machine's IP). Also tried http://localhost:5050 and http://127.0.0.1:5050, but none worked.
Ran docker ps and confirmed that PgAdmin is exposing port 5050. Used netstat -tulnp and curl http://localhost:5050, but no response.
Ran docker logs pgadmin but found no critical errors.
Disabled firewall temporarily (sudo ufw disable). Verified that Docker is using the bridge network (docker network inspect bridge).
Upvotes: 0
Views: 33