Hi!
While this was asked a while ago, I believe the following information will be able to help future visitors who might be experiencing the same issue:
In order to bind a program to port 80 or any port under 1024, it needs to have root privileges. Running an app as root is most of the time a bad idea, so, what is usually done is running a reverse proxy such as nginx or HAProxy on port 80 that forwards all incoming requests to the MEAN app on port 3000.
First, install nginx:
sudo apt-get update
sudo apt-get install nginx
Then, replace the default server block in /etc/nginx/sites-available/default
with the following:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Finally, restart nginx:
sudo service nginx restart
nginx should now be listening on port 80 and forwarding all requests to the MEAN app that is running on port 3000.
If you’re running the app in production, you will need to set it up so that it automatically starts on boot and restarts when it crashes. Take a look at the Install PM2 and Manage Application with PM2 sections in the following tutorial:
How To Set Up a Node.js Application for Production on Ubuntu 14.04
One other option, which is true only if you’re running Ubuntu 15.04 or later, or different OSes that use systemd as the init service, would be creating a systemd service as described in this tutorial.

by Felix Saparelli
When deploying a web application to a Droplet, it might be tempting to simply use the same kind of setup as is used in development, i.e. starting the server by running "ruby app.rb" or "node server.js" in a terminal. This is simple and easy, while providing visible logs.This is dangerous: what happens if the server crashes and no one is around to restart it? This tutorial uses a simple Node.js application, but is applicable to most, if not all, others as well (be they Ruby, Python, etc.)
I have to same issue and need some help also!
Answer 1:
What I did was use the linux screen command in order to have the process run on a different thread.
There is probably a better way to do this, but so far this has worked perfectly.
I have two servers up a few months now with no issues.
Answer 2:
You should use a program that deals with web traffic (load balancing / port forwarding) such as Nginx in order to forward request from port 80 to the MEAN stack (port 80).
This is great because you can run multiple web services on one machine and Nginx will forward correctly, also if your app gets really successful you can then easily scale with load balancing features.
OR
You can have open up port 3000 and then access your MEAN stack via:
http://<server-ip>:3000
Summary:
Use the linux screen command:
http://www.computerhope.com/unix/screen.htm
Use Nginx:
https://www.nginx.com/resources/wiki/
User CrypticDesigns answered a similar question of mine here (he explains screen):
https://www.digitalocean.com/community/questions/how-to-run-grunt-command-in-background-for-the-mean-stack?answer=24811