Good try but this won’t work unless you change some of you code. The default port your browser will try to access is: 80. You are probably using something like port 3000. So quick fix is to change your server port to port 80.
A better option is to determine if you are on production or development mode and adjust the port depending on your environment.
If you don’t have a Node Env variable for dev, follow this: http://stackoverflow.com/questions/22312671/node-js-setting-environment-variables
Here is how this would look:
If setting up your node environment is causing your problems, you can also add a key to a file non-tracked by Github — could be something like keys.js. On your computer you can then define env as DEVELOPMENT and on your droplet, set that env as PRODUCTION. Then, in your server, after importing that file — something like:
var keys = require('./config/keys.js)
You can choose a port number with a simple if statement:
Alright! Let’s push that change to github, then ssh to server on your project directory, git pull then:
$ forever stopall
$ forever start server.js
$ forever restartall
You are done. Going to your IP address will ping your server, and the rest is magic.
Now, a couple of things:
Buy a domain
Point DNS records to Digital Ocean:
How To Set Up a Host Name with DigitalOcean | DigitalOcean DigitalOcean’s DNS allows you to easily set up your hostname from the DigitalOcean control panel. Before you get…www.digitalocean.com
There are some changes you probably want to make to your droplet (mostly for security reasons):
Initial Server Setup with Ubuntu 14.04 | DigitalOcean When you start a new server, there are a few steps that you should take every time to add some basic security and give…www.digitalocean.com