Running HashBrown as a service

How to make sure HashBrown is always running on your server


To do this, all you need is a fairly recent Linux OS on your server with systemd as the init system.

Creating a systemd Service File

Create a new file with your preferred text editor:

$ sudo vi /lib/systemd/system/hashbrown.service

Type/paste the following into the file:

Description=HashBrown CMS 

Environment=PORT=8080 (or whichever port you want to run it on)
User=username (never root!)
ExecStart=node /path/to/hashbrown-cms/hashbrown.js


Reload the daemon

$ sudo systemctl daemon-reload

Start the service

$ sudo systemctl start hashbrown