Access to the node app in the digital ocean - this site cannot be reached

I cannot access my node js digital oceanic app. I have already done SSH, cloned the node application from Git, npm and successfully launched the application in a drop, but I get an error

This site cannot be reached.

enter image description here

Digital Ocean docs say you can access your public site simply by going to <your website ip>:<port> :

enter image description here

I did this by going to 67.205.185.63:9000/ (my application runs on port 9000, as you can see):

root @ nodejs-512mb-nyc1-01: ~ / demos # npm start

live-demos@1.0.0 start / root / demos

node app.js

Demos is listening on port 9000

How else can I access my node application?


 var express = require('express'); var bodyParser = require('body-parser'); var app = express(); var port = process.env.PORT || 9000; ... app.listen(port, function () { console.log('Demos is listening on port ' + port); }); 
+5
source share
1 answer

Some digital ocean drops (mostly one-click apps ) come with the ufw firewall and by default all ports except 22, 80 and 443 are blocked.

To check if ufw is installed and which ports are blocked / open, do:

sudo ufw status

Output:

 To Action From -- ------ ---- 22 LIMIT Anywhere 80 ALLOW Anywhere 443 ALLOW Anywhere 22 (v6) LIMIT Anywhere (v6) 80 (v6) ALLOW Anywhere (v6) 443 (v6) ALLOW Anywhere (v6) 

To allow traffic on port 9000:

 sudo ufw allow 9000/tcp 
+13
source

All Articles