title: Cannot connect to Postgres running in Docker from PGAdmin running on Windows Host
body: <p>I have read all the questions on this, <a href="https://stackoverflow.com/questions/25540711/docker-postgres-pgadmin-local-connection?rq=1">like this one,</a> but it does not help.</p>
  
  <p>Host: Windows 10, running VirtualBox and PgAdmin.</p>
  
  <p>I have setup Docker correctly and run a few containers without issue. Now I tried to setup Postgres. I tried two:</p>
  
  <p>1 <a href="https://hub.docker.com/r/paintedfox/postgresql/" rel="noreferrer">https://hub.docker.com/r/paintedfox/postgresql/</a></p>
  
  <p>2 <a href="https://hub.docker.com/_/postgres/" rel="noreferrer">https://hub.docker.com/_/postgres/</a></p>
  
  <p>And both have the same issue. When I try to connect from PgAdmin, it says the server does not listen.</p>
  
  <p>When I run <code>docker inspect postgres</code> I see</p>
  
  <blockquote>
    <p>"NetworkSettings": {
                "Bridge": "",
                "SandboxID": "6ad76f4d61017c44f814c5ec7ab9081a650d925a46c2b69902c4f0e5209076ce",
                "HairpinMode": false,
                "LinkLocalIPv6Address": "",
                "LinkLocalIPv6PrefixLen": 0,
                "Ports": {
                    "5432/tcp": null
                },
                "SandboxKey": "/var/run/docker/netns/6ad76f4d6101",
                "SecondaryIPAddresses": null,
                "SecondaryIPv6Addresses": null,
                "EndpointID": "3f14630554c972ac875cbb384725c6970d1d4d5acfba7cbc05e416b5b22f0056",
                "Gateway": "172.17.0.1",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "IPAddress": "172.17.0.2",</p>
  </blockquote>
  
  <p>I have tried that IP address as the host in PGAdmin.</p>
  
  <p>I have tried setting the container with -p 5432:5432 and connecting as 127.0.0.1:5432.</p>
  
  <p>I have tried setting port forwarding in VirtualBox for the container. </p>
  
  <p>I also tried the machine host, as shown in Kitematic: 192.168.99.100</p>