0curl: (7) Failed to connect to port 80: No route to host

I logged in as root user & followed this link

for basic configuration of my server. When i tried to download tomcat using the command: curl -O

it always shows the message: 0curl: (7) Failed to connect to port 80: No route to host

I haven’t found any solution for overcoming this issue.


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

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.

Hi @buddiesworkshop07,

You’ve disabled or haven’t enabled connections from your Droplet on port 80. If you are using UFW, you can use it to allow the connections like so:

sudo ufw allow out 80
sudo ufw allow 80

If you are using IPtables instead of UFW, you can try using the following:

sudo iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -p tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT
sudo iptables -A OUTPUT -o eth0 -p tcp --dport 80 -j ACCEPT

The above should help out