My Node.js app runs fine on my droplet (Ubuntu 22.04). curl localhost:3000
gives the expected output, but I can’t access it from outside via the public IP.
UFW is open on port 3000
App’s listening on 0.0.0.0:3000
No reverse proxy or SSL yet — just raw testing
I thought wearing a kilt might grant me dev magic. Turns out, I might just need proper networking advice.
Thanks in advance!
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!
Hi there,
If curl localhost:3000
works but hitting it from outside doesn’t, and UFW is open on port 3000, there are a couple things to double-check:
First, make sure your app is actually listening on 0.0.0.0
and not just localhost
. Sounds like you’ve done that, but it’s worth verifying with:
sudo lsof -i -P -n | grep LISTEN
Next, check if your cloud firewall (from the DigitalOcean control panel) is blocking port 3000. Even if UFW is open, the cloud firewall takes priority, you’ll need to explicitly allow TCP traffic on port 3000 there.
Once that’s done, try again via your public IP and port 3000. If it still doesn’t work, try temporarily disabling UFW just to rule it out:
sudo ufw disable
If it works with UFW off, then something’s off in the UFW config.
Once you’ve got it working, you can throw Nginx in front later, but for now, that should get you going.
Let me know how it goes!
- Bobby
Heya, @c47b996f44304e70afeb1bc98107f5
I’ll also recommend the quick test with disabling UFW
. If it works while temporarily disabled, then you know where the culprit of the issue is.
Regards
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.