Node.js with express is accessible only via port 80.

August 25, 2018 3.7k views
Node.js Debian

Hello,
I managed to setup my test app (NODE/Express) on http://178.128.173.30/ but I can access it through http:// only when app.listen(80);

I have opened few other ports in console with sudo ufw allow but none of them working. Am I missing something?

Current sudo ufw status below:

To Action From
22 LIMIT Anywhere
80 ALLOW Anywhere
443 ALLOW Anywhere
Nginx HTTP ALLOW Anywhere
50/tcp ALLOW Anywhere
50 ALLOW Anywhere
80/tcp ALLOW Anywhere
21/tcp ALLOW Anywhere
500:600/tcp ALLOW Anywhere
500:600/udp ALLOW Anywhere
22 (v6) LIMIT Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
Nginx HTTP (v6) ALLOW Anywhere (v6)
50/tcp (v6) ALLOW Anywhere (v6)
50 (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
21/tcp (v6) ALLOW Anywhere (v6)
500:600/tcp (v6) ALLOW Anywhere (v6)
500:600/udp (v6) ALLOW Anywhere (v6)
1 comment
  • How did you setup it on digitalocean, I mean I am trying to manage my app (clone of a github app) but it is not running on port 3000

    Please help.

3 Answers
by Brennen Bearnes
Node.js is an open source JavaScript runtime environment for easily building server-side and networking applications. Node.js applications can be run at the command line but this guide focuses on running them as a service using PM2, so that they will automatically restart on reboot or failure, and can safely be used in a production environment.

But I don't need Nginx - I use Express. As I wrote above I have set up server successfully. I can't make app work on other port than 80.

I have read all those before posting here. Thx I will search somewhere else this is pointless :)

  • Well you should really first make sure that the app is listening on your desired port with something like lsof -i :port or netstat -tupan |grep port . After try pinging the desired port with the tool i provided above(could be a local block from your ISP).

Have another answer? Share your knowledge.