Skip to content

Instantly share code, notes, and snippets.

@bcomnes
Last active December 14, 2015 00:02
Show Gist options
  • Select an option

  • Save bcomnes/4d36e643672cbc2c346d to your computer and use it in GitHub Desktop.

Select an option

Save bcomnes/4d36e643672cbc2c346d to your computer and use it in GitHub Desktop.
Example node systemd service
# Put in /etc/systemd/system or ~/.config/systemd/user/ if running with --user flag
[Unit]
Description=Example Node Systemd Service
[Service]
ExecStart=/usr/local/bin/node /home/project-folder/server.js
Restart=always
StandardOutput=syslog
SyslogIdentifier=logid
Environment=NODE_ENV=production PORT=80
# uncomment and set user to run service as a different use than root
#User=<username to run as>
[Exec]
RootDirectory=/home/project-folder
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment