Skip to content

Instantly share code, notes, and snippets.

@bryanchance
Forked from dceejay/nssm.md
Created January 15, 2023 05:29
Show Gist options
  • Save bryanchance/f350a2d35da2b1342efd13a7ae8fb095 to your computer and use it in GitHub Desktop.
Save bryanchance/f350a2d35da2b1342efd13a7ae8fb095 to your computer and use it in GitHub Desktop.
Running Node-RED as a service on Windows using NSSM

Running Node-RED as a service on Windows using NSSM

These instructions assume you installed Node-RED from an administrator enabled command prompt using the npm install -g node-red command to do so.

As an administrator, install nssm from https://nssm.cc/download

And then from the directory where you installed nssm, run the commands

mkdir c:\temp
nssm install Node-RED "c:\Users\\"%USERNAME%"\AppData\Roaming\npm\node-red.cmd"
nssm set Node-RED AppDirectory "c:\Users\\"%USERNAME%"\.node-red"
nssm set Node-RED AppParameters "-u c:\Users\\"%USERNAME%"\.node-red > c:\temp\node-red.log"
nssm set Node-RED Description "A wiring tool for the Internet of Things"

You can edit the service using the GUI to the configuration, add extra parameters, etc.

nssm edit Node-RED

The log will be written to c:\temp\node-red.log (see line 3)

For further options read the nssm usage page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment