How do I access exposed ports on my Docker containers from outside the VM?

Posted April 17, 2014 20.4k views
So, I've installed Shipyard by following the Quickstart guide, and I now have a container running called `shipyard` which exposes a HTTP server on I can access it just fine from within the droplet using curl, but I can't connect to it over the Internet. I've tried disabling ufw; as well as enabling it, setting DEFAULT_FORWARD_POLICY="ACCEPT" in /etc/default/ufw and allowing port 8000. I've tried using multiple VMs in multiple regions, even. I'm using a newly-created droplet with the Docker image.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer
You need to set up a proxy to forward the connection on. We have a tutorial explaining how to use nginx to do that:

That should point you in the right direction. Let us know if you need any more help!
by O.S Tezer
In this DigitalOcean article, our goal is to learn about creating a docker container from a base image and building it to run Nginx (layer by layer). Later, following the steps from the beginning, we create a Dockerfile to automate the process using a custom input file for configurations. In the end, using this Nginx docker image, it becomes possible to create self-contained sandboxes running Nginx, which can be used to serve "dockerised" applications.