Question

Impossible to Open TCP Port to External App

Hi all,

I’m giving this a go as my last resort. It seems Droplets do not have the option of opening a custom TCP port to external applications. I can open the port internally, but no way to access it externally.

I’ve tried everything I know, including a couple of DO tutorials that cover things that simply don’t work.

DigitalOcean have obviously done something here, block ports for some reason, given the number of posts and lack of clear answers.

Is it a money thing? Will the block ‘go away’ if I pay more?

Any insight would be welcome. If that is just ‘forget it, it’s not going to happen here’ fair enough. I’ve lost a day, but better than losing 2 or 3.

Massively disappoint with DO. It could be a great service. But this abstraction of TCP ports, which you only discover once you’d installed everything, is not fun or fair.


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
January 12, 2025

Hey Mike! 👋

I saw your earlier message and updated my response there too, but I wanted to follow up here to clear things up.

First off, I can assure you this isn’t a money thing, DigitalOcean doesn’t charge extra to open TCP ports on Droplets.

Droplets give you full control over your server, and opening ports is definitely possible. It just comes down to a couple of key configurations that I mentioned in my previous reply:

  1. Make sure your application is actually running and listening on the port you want to open. Also, ensure it’s bound to 0.0.0.0 (not localhost) to accept external connections. Example for a Node.js app:

    app.listen(8080, '0.0.0.0');
    
  2. If you’re using DigitalOcean Cloud Firewalls, confirm that the port is allowed for inbound traffic. If you’re using a firewall on the Droplet like ufw, you can open the port like this:

    sudo ufw allow 8080/tcp
    sudo ufw reload
    

    No firewall? Then once your service is running, it should be accessible.

  3. Run this command to check if the port is being listened on:

    sudo netstat -plant | grep 8080
    

    If it shows up, the service is listening. You can then test the port externally with:

    curl http://your_droplet_ip:8080
    

On another note, in rare cases, your local network or ISP might block certain ports. Testing from a different network or using a VPN could rule this out.

Droplets give you complete freedom over networking, so there are no hidden restrictions here.

Let me know how it goes! If it is still not working, feel free to share the output of the netstat command here.

- Bobby

KFSys
Site Moderator
Site Moderator badge
January 12, 2025

Heya,

Are you sure anything is listening on that port? Opening port but nothing listening on that port will make it appear as closed from the outside.

Basically, you need to have something listen to that port in order to open it to the outside world.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.