Docker Community Forums

Share and learn in the Docker community.

Getting connection timedout error while accessing portainer webpage running in docker container

docker version -

Version: 17.06.2-ce
API version: 1.30
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:57:21 2017
OS/Arch: linux/amd64

Server:
Version: 17.06.2-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: cec0b72
Built: Tue Sep 5 19:59:19 2017
OS/Arch: linux/amd64
Experimental: false

We downloaded the Portainer latest image and with docker image command seeing this

REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest 2622e6cca7eb 5 days ago 132MB
portainer/portainer latest cd645f5a4769 13 days ago 79.1MB
ubuntu latest 1d622ef86b13 7 weeks ago 73.9MB

Then we ran the following command
docker run -d -p 8020:8000 -p 9020:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Now if we run docker container ps we are seeing the following output
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d53dfad09d0c portainer/portainer “/portainer” 2 hours ago Up 3 minutes 0.0.0.0:8020->8000/tcp, 0.0.0.0:9020->9000/tcp portainer

We went through the previous posts and made sure that we use the -p option to publish. Since port 9000 was already bound we had to map to another port

docker inspect revels that the publish is done successful

“Ports”: {
“8000/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “8020”
}
],
“9000/tcp”: [
{
“HostIp”: “0.0.0.0”,
“HostPort”: “9020”
}
]
},
“SandboxKey”: “/var/run/docker/netns/d8dfab148570”,
“SecondaryIPAddresses”: null,
“SecondaryIPv6Addresses”: null,
“EndpointID”: “515cb45516a8e7036ace013da6e58f0c563cddfad500e4c63b079036a47fd5ea”,
“Gateway”: “172.17.0.1”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“IPAddress”: “172.17.0.2”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“MacAddress”: “02:42:ac:11:00:02”,
“Networks”: {
“bridge”: {
“IPAMConfig”: null,
“Links”: null,
“Aliases”: null,
“NetworkID”: “84fcfbd206c64ab51d1d6804daaef076c6852e05fb284b91c9727669c70bfcd4”,
“EndpointID”: “515cb45516a8e7036ace013da6e58f0c563cddfad500e4c63b079036a47fd5ea”,
“Gateway”: “172.17.0.1”,
“IPAddress”: “172.17.0.2”,
“IPPrefixLen”: 16,

However when we try to access the url http://127.0.0.1:9020 we are not getting the admin page loaded… getting connection timed out errors

not sure what we are missing. any help will be appreciated