How do I get my droplet to listen on port 80 and port 443?

Posted April 2, 2020 12k views

I can connect to my droplet through Putty and DO console, but not through any web browser to connect to wordpress login admin. The problem: tcp ports 80 and 443 are now showing closed and connection refused. DNS A record (DO gave me a new IP) also not cached around the world even after 4 days. Double checked configuration in the droplet and set droplet firewall (even though none were set in the first place), and applied sudo rules UFW in console for allowing the ports. Domain is configured correctly. Disabled my own firewall on windows. What could the problem be??

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
3 answers

Hi @martyncompu,

There are a few possible issues. Firstly, in order for the ports to be opened, something would need to listen to them. On port 80 and 443 usually what listens to them are services like Apache/Nginx. They are used to process the requests on the server and server the websites on it. Having said that, please make sure you have either Apache or Nginx installed and configured.

If you are unsure how, you can check the following articles:

Install and configure Apache

Install and configure Nginx


  • If you are using UFW, you can execute
sudo ufw allow 80
sudo ufw allow 443
  • If you are using only IPtables, you can execute
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 443 -j ACCEPT


Lastly, make sure your Domain’s DNS is properly configured and is pointing to your Droplet. Again, there is pretty good DigitalOcean documentation related to this which can be checked here


by Justin Ellingwood
by Kathleen Juell
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or reverse proxy. In this guide, we'll discuss how to get Nginx installed on your Ubuntu 18.04 server.

Hi @KDSys,

Thanks for responding, but this droplet is a one-click install. Why do I need to download apache/Nginx?

This was the initial install:

  • Hi @martyncompu,

    I see, this wasn’t tagged on the question so I couldn’t have known. Having said that, can you please run the following commands and let me know what their outputs are so that I can give you a more pinpoint answer:

    netstat -tulpen | grep 80
    netstat -tulpen | grep 443
    ufw status


    • My apologies for that. Forgot to include it. What is the DO console command or cmd command alternative for “nestat -tulpen | grep 80?”

      Thanks for helping.

Ive just recieved an email from DO and they are kind of urging me to create a new droplet using this guide:

I think that’s what I will do later on. Apparently the current droplet im using doesn’t include a web server - no idea what happened!

  • Hi @martyncompu,

    I see, It did find me strange you don’t have a WebService using the DigitalOcean WordPress one click app.

    Having said that, when you install it, if you find any problems, please do post them here. I’ll be sure to try and help out