I am developing a
It's hard to beat a good VPS if you need to install custom software that is not easy to install with npm. My favorite VPS provider is Digital Ocean. You can have two months of a basic server for free with this link so you can see if it's ok for you before you pay anything. But it will mean taking care of the server yourself. With services like Heroku all of that is taken care for you - but you can't install whatever you want there. With a VPS you get your own server with root access. Usually it's Linux but Digital Ocean also supports FreeBSD and some people install OpenBSD, though it's not officially supported. With a VPS you can install whatever you want, but you have to do it yourself. There is always a trade off.
To install Node on the VPS, my recommendation is to install in
/opt with a versioned directory and a symlink - this is an example procedure that I wrote for a different answer:
# change dir to your home: cd ~ # download the source: curl -O https://nodejs.org/dist/v6.1.0/node-v6.1.0.tar.gz # extract the archive: tar xzvf node-v6.1.0.tar.gz # go into the extracted dir: cd node-v6.1.0 # configure for installation: ./configure --prefix=/opt/node-v6.1.0 # build and test: make && make test # install: sudo make install # make a symlink to that version: sudo ln -svf /opt/node-v6.1.0 /opt/node
See this answer for more info.
To have your own application nicely started on server startup - here is an example Upstart script based on the one that I'm using - it should work on Ubuntu 14.04, not tested on newer versions - save it in
# When to start the service start on runlevel  # When to stop the service stop on runlevel  # If the process quits unexpectadly trigger a respawn respawn # Start the process exec start-stop-daemon --start --chuid node --make-pidfile --pidfile /www/YOURAPP/run/node-upstart.pid --exec /opt/node/bin/node -- /www/YOURAPP/app/app.js >> /www/YOURAPP/log/node-upstart.log 2>&1
YOURAPPto the name of your own app
/opt/node/bin/nodeto your path to
/www/YOURAPP/app/app.jsto the path of your Node app
/www/YOURAPP/runto where you want your PID file
/www/YOURAPP/logto where you want your logs
--chuid OTHERUSERif you want it to run as a different user than
(make sure to add a user with a name from
/etc/init/YOURAPP.conf in place you can safely restart your server and have your app still running, you can run:
start YOURAPP restart YOURAPP stop YOURAPP
to start, restart and stop your app - which would also happen automatically during the system boot or shutdown.