Question

Installed meanstack on ubuntu 14.04

Posted October 1, 2014 2.6k views

Hello everybody , i just installed mean on my droplet , is it nessesary to configure “forever” or what other workaround is required in order to make it run permanently.

Thanks

meanjs.tk

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

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
respawn

setuid ghost
setgid ghost
env NODE_ENV=production
chdir /var/www/ghost

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.

Submit an Answer