Question

Cannot connect to app externally

I have a python app running at port 9000 and want to connect externally. So, I open port 9000 in ufw, checked wheather port app is listen and created rule at Digital Ocean firewall. I can connect to postgres at port 5432 and ssh, but cannot connect to port 9000.

sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      692/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      877/sshd
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      937/postgres
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      1184/python3.6
tcp6       0      0 :::22                   :::*                    LISTEN      877/sshd
tcp6       0      0 :::5432                 :::*                    LISTEN      937/postgres
sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
9000/tcp                   ALLOW       Anywhere
9001/tcp                   ALLOW       Anywhere
10001/tcp                  ALLOW       Anywhere
10000/tcp                  ALLOW       Anywhere
5432/tcp                   ALLOW       Anywhere
22/tcp                     ALLOW       Anywhere
22                         ALLOW       Anywhere
9000/tcp (v6)              ALLOW       Anywhere (v6)
9001/tcp (v6)              ALLOW       Anywhere (v6)
10001/tcp (v6)             ALLOW       Anywhere (v6)
10000/tcp (v6)             ALLOW       Anywhere (v6)
5432/tcp (v6)              ALLOW       Anywhere (v6)
22/tcp (v6)                ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)

Print of Droplet Firewall

Can someone help me, please?


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.

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.

Hi there @nevessmichel,

This actually looks all correct, so I think that it might be your local network closing the connections to that custom port. In order to do that you could run the following command from your computer:

  1. telnet portquiz.net 9000

If you are not able to connect then this would indicate that port 9000 is closed on your local network.

Let me know how it goes! Regards, Bobby