node.js


Access node app on digital ocean - This site can't be reached


I am unable to access my digital ocean node js app. I've already SSH'ed in, cloned my Node app from Git, npm installed, and successfully started the app on the droplet, yet I get error
This site can't be reached
Digital Ocean docs say you can access your publicly facing website simply by going to <your website's ip>:<port>:
I did this by going to 67.205.185.63:9000/ (my app is running 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 should I be accessing my node app?
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);
});
Some Digital Ocean droplets (mainly one-click apps) come with ufw firewall installed and by default all ports except for 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 do:
sudo ufw allow 9000/tcp

Related Links

How to save array data in nodejs using mongoose?
Error while running npm & unable to install npm on homestead
Iterate over every document in mongodb from nodejs
How to properly use Duplex streams in node.js
Dependency warning IONIC
node-schedule read the value of a set timer
how to develop a api ai with node-js web application?
How do I know how to scale my Heroku app? (graphs included, but I don't know how to interpret them)
Mongoose using subquery in aggregation to sum data
Facebook login name field missing
$match aggregate not working with date range in node
npm run build doesn't seem to work
mongodb generate the same ObjectID when save data
Express next() wont invoke next middleware
Node.js call a function after n seconds of script runtime
Feathersjs administrator role (or feathers middleware with auth check)

Categories

HOME
github
perl
local-storage
sendmail
mongoose
entities
keen-io
integration-testing
amazon-redshift
inform7
codeception
directive
bigdata
angularjs-ng-transclude
logstash-grok
shogun
emu8086
prefix
systemml
netbeans-7.3
spring-statemachine
build-automation
couchbase-view
nattable
uiinterfaceorientation
http-caching
webcam
hal
angular-openlayers
spring-4
neoscms
chmod
aspose-cells
magnolia
quickbooks-online
product-key
userfrosting
sqlcmd
interactive
lift
sencha-architect
webos
auto-value
ole
ranorex
evosuite
measurement-studio
webpack-style-loader
hasownproperty
google-gadget
c#-to-vb.net
voxel
ms-project-server-2013
android-image
compass
mds
nsthread
antivirus-integration
unreal-blueprint
orchardcms-1.9
sos
blackberry-simulator
iterm
r1soft
irs
realbasic
singularitygs
undefined-symbol
sin
template-strings
gcdasyncsocket
savefiledialog
apache-roller
hashbytes
mysql-num-rows
filefield
xcode-instruments
teamsite
raii
mashup
buttonclick
phpmotion
.class-file
sniffing
outlook-2003
pull-to-refresh
jquery-mobile-collapsible
badimageformatexception
mercurial-subrepos
timezoneoffset
twisted.internet
windows-explorer
language-theory
incremental-linking
uint32
trackback
flashlite

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App