Please use this thread to provide and update tools and methods for running Node-RED on Windows (10+ and Windows Server).
NOTE: This FAQ should be read as an extension/update to the official documentation on running Node-RED under Windows.
There are 4 basic approaches to this:
- Run manually
- Run as a Service
- Run using Windows Task Scheduler
- Run via IIS (Windows web server)
1) Run Manually
As a node.js app, Node-RED can easily be run manually from the command line or a suitable shortcut. This runs under your logged-in user id and so inherits the same permissions.
You can also use PM2 which will help with auto-restarts, log management, etc.
Either way, consider altering the
package.json file in your userDir (typically
/Users/<userid>/.node-red) and adding
logs scripts so you don't need to remember each time how to run things. A default install (e.g.
npm install -g --unsafe-perm node-red) will install a system-wide command
This method is good for developing flows for running elsewhere and to use Node-RED as a utility locally.
2) Run as a Service
3) Run using Windows Task Scheduler
4) Run via IIS (Windows web server)
... TBC ...
I recommend using a specific user id to run node-red if you wish to have it permanently running in the background. SYSTEM has a lot of access and might be abused. This is in line with my security recommendations for running node-red under Linux too.
If you simply want to run it periodically as a Windows app, I recommend using PM2 to run it under your current user id - you can use the package.json in your userDir folder to define some npm scripts to start/restart and show logs. You can also use a watch list for auto-restart after key file changes.
The other approach is to turn on IIS which is Windows' web server and it can be used as a reverse proxy. There is an extension for it that lets it manage node.js services directly. I need to dig out the name of that.
The official docs mention using Chocolatey to install node.js - this can not really be recommended any more unless you happen to already be invested in that tool. It will probably work fine but is no longer the best way for modern versions of Windows.
Instead, either install using the installer from the Node.js official website or use the now native
winget tool if you want a command-line installer.
To update node.js, either re-run the installer or use
winget upgrade nodejs-lts (which will update to the latest version of the latest LTS version). There are also packages in winget for current and nightly builds. You can also specify a particular version but at the moment, you have to go find the correct version string. Winget also has a 3rd-party UI tool in case you want it.
Note that newer versions of Node.js for Windows include the windows-build-tools so you don't need to do that separately.