Docker Community Forums

Share and learn in the Docker community.

How to access Docker outside the host


I configured tomcat image with port 8080 and wanted to access it from lan. I expose the port 8080 but still not able to access tomcat. Also once expose the port how do I get the IP address of docker image ( to

Please help.

(Martin Terp) #2


You should be able to access it by the host ip, and port 8080, if you run it locally you can use: http://localhost:8080

Regarding your other question, im not sure what it is you want to do?


Hi Martin,

Thank you for your prompt reply.

I am new in docker.

Actually what I want is I have configured tomcat on docker image and that image I wanted to access from our LAN by exposing port 8080. I tried to expose the port using the command mentioned on this site

the main point is I wanted to access the tomcat from my LAN (other lan machines). How can I do that. Could you please explain?



(Martin Terp) #4

If you have run a container, via docker run -p 8080… you should be able to just access it via the HOST ip, that is the host you installed docker on.
So if your server has ip:, you should be able to see the tomcat pages on:


My docker Ip is and I am able to access it via localhost. But If I want to access it from Host or from other machines from LAN so how can I do that? Because from host machine I am able to ping to docker image i.e. So how can I access it from other LAN machines?

(Tekki) #6

Don’t worry about ‘Docker IPs’. Take the second example from ‘How to use this image’ in Tomcat on Dockerhub as a starting point. If your machine has (as you write) IP you can now find Tomcat at


My LAN ip address is 192.168.1.XXX. I deployed new tomcat image and then also I am not able to access tomcat from other machine. How can I expose the tomcat port 8080 and how can I get the docker IP in 192.168.X.XXX range after expose the port.I mean where should I find the docker IP address in 192.168.1.XXX.