How do I update the DO Docker droplet to enable ports 80 and 443?

Posted April 7, 2020 3.2k views

I have set up new droplet using the DO droplet ( The documentation says that the default firewall for the Docker One-Click is UFW, but I can’t find a way easily enable ports 80 and 443.

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

Hi @bsscdt ,

Try this command:

docker run -p 80:80 -p 443:443 --name nginx -d nginx

The --name should be the name of your docker container.If you don’t pull nginx yet,also run this before the command I mentioned to mapping 80/443 ports:

docker pull nginx