So my company has a webserver on port 4000 (Cloudflare) and mongodb on port 27017. I tried to do ufw allow 27017/tcp, or ufw allow 27017, ufw allow 4000, ufw allow 4000/tcp. However when I’ve done an nmap scan the ports are still closed for some reason. Why is this? What am I missing? I’ve tried to enable nginx and apache but we already have a webserver on cloudflare, so isn’t it mood point?
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!
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 there,
In order for you to be able to access those services externally, besides allowing the ports via your firewall, you need to make sure that they bind on
0.0.0.0
rather than127.0.0.1
.For example, with MongoDB you can do that by following the steps here:
https://www.digitalocean.com/community/tutorials/how-to-configure-remote-access-for-mongodb-on-ubuntu-20-04
For the service that is listening on 4000, can you confirm what type of service is it?
Best,
Bobby
Hello there,
What is your problem? Your droplet has this ports open but you can’t to connect to them?
From your Droplet
Check out your open ports
Check out the current status of your firewall
From outside your Droplet
Check out your open ports
If you need to check a specific port
Hope this helps,
Sergio Turpín
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.
Sign up now