The MEAN image simply provides you with a good starting point to build your project. It comes with Node and MongoDB preinstalled. In order to keep your project running, there are a number of approaches that you can take. Personally, I like to use the native init system as it allows you to manage your project like any other service on your server using commands like
sudo service myapp restart
On Ubuntu 14.04, the init system is Upstart. You can use it to start and keep running Node apps. For example, DigitalOcean’s one-click Ghost app uses an Upstart script to have Ghost start on boot. It looks like:
description "Ghost: Just a blogging platform"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]
# If the process quits unexpectedly trigger a respawn
exec /usr/local/bin/npm start --production
pre-stop exec /usr/local/bin/npm stop --production
and it is installed to
/etc/init/ghost.conf Of course, you’ll need to update it to reflect your project, but hopefully that points you in the right direction.