Opening a port to an application accessible outside of localhost?

Posted April 9, 2016 7.2k views
Linux Basics

I’ve seen this question asked a million times before, but I’ve never seen a satisfactory answer. “All ports are open by default.” is not helpful.

* Running on (Press CTRL+C to quit)

lsof -i :5000 yields

python  11824 root    3u  IPv4 10213572      0t0  TCP localhost:5000 (LISTEN)

But it doesn’t work. I have this working on localhost, but it just won’t work over the internet. shows that the port is closed.

Does anyone have any advice?

1 comment
  • If anyone is looking for the answer to a similar question. Ensure that your application is referencing your domain. Loopback issues were the problem here and I suspect they may be in other questions that weren’t answered.

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.

Submit an Answer
1 answer

Your program is listening on, the loopback interface, which mean that it’s only accessible from the Droplet itself. In order to be able to access it externally, you will need to configure it to bind to instead.