Unreachable content (Docker containers) on other ports than 80

Hello everybody,

I have a problem accessing Docker containers for any other port than 80. Previously it worked and I had services accessibles on ports 5000 and 7000 in addition to a nginx server installed directly on the droplet. I recently do a dist-upgrade to Ubuntu 18.04.1 LTS and that may have broken stuff.

What works:

  • accessing a page on port 80 or 443 served by nginx (without docker)
  • accessing my docker container from another machine if bind on port 80
  • accessing my docker container from the localhost regardless of port

What doesn’t work:

  • accessing a page on port 81 served by nginx (without docker)
  • accessing my docker container if bind to port 5000 or 7000

So it seems there is a problem with other ports than 80 and 443 for serving content on the internet. I have no digital ocean firewall configured. I tried to look iptables stuff but I understand very little and don’t manage to find anything suspicious.

I would need your help to solve this case.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


I believe that this could be due to your firewall. You need to make sure that the ports that you are trying to access are open. If you are using the default Ubuntu firewall, you could do that with:

  • Check the status of the firewall and the open ports:
sudo ufw status
  • Open a specific port:
sudo ufw allow 81

Regards, Bobby