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!
Hello there,
What is your problem? Your droplet has this ports open but you can’t to connect to them?
Check out your open ports
- netstat -putan
Check out the current status of your firewall
- sudo ufw status verbose
Check out your open ports
- nmap your_droplet_ip
If you need to check a specific port
- nmap -p 4000 your_droplet_ip
Hope this helps,
Sergio Turpín
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 than 127.0.0.1.
For example, with MongoDB you can do that by following the steps here:
For the service that is listening on 4000, can you confirm what type of service is it?
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.