Node-RED is a free, browser-based tool for wiring devices, APIs and services together by connecting nodes into flows. Running it on your Windows PC is the quickest way to learn it and prototype IoT dashboards before moving to an always-on Raspberry Pi.
Quick answer: install the Node.js LTS from nodejs.org, open a new PowerShell window, run npm install -g --unsafe-perm node-red, then run node-red and open http://localhost:1880. If PowerShell says running scripts is disabled on this system, run the commands from Command Prompt instead, or allow scripts for your user once (see Troubleshooting).
This guide covers each step, a first test flow, where your flows are stored, adding nodes such as Dashboard 2.0 and MQTT, password-protecting the editor, starting Node-RED automatically, and fixes for the errors Windows users hit most.
What You Need
- Windows 10 or 11, 64-bit.
- Node.js 18 or newer. Node-RED 4.x needs at least Node 18; the current Node.js LTS release is the right choice.
- An internet connection for the first install.
- A normal user account. You don't need to run PowerShell as administrator for any step in this guide.
Already have Node.js? Check the version with node --version. If it's older than 18, install the current LTS over it.
1. Install Node.js
Download the LTS Windows installer (.msi) from the official Node.js website and run it. Keep the defaults: npm package manager and Add to PATH must stay enabled. You can leave Tools for Native Modules unticked; Node-RED and its common nodes don't need it.
When it finishes, close any open terminals and open a new PowerShell window so it picks up the new PATH. Then check:
node --version
npm --versionEach command should print a version number, for example v22.x.x and 10.x.x. If PowerShell says node is not recognized, open a fresh window; if it still fails, rerun the installer and choose Repair.
2. Install Node-RED
In PowerShell or Command Prompt, run:
npm install -g --unsafe-perm node-red-g installs it globally, so the node-red command works from any folder. --unsafe-perm is what the Node-RED documentation recommends; it avoids permission problems while some nodes build. The install takes a minute or two. Lines about funding or deprecated packages are warnings, not errors.
npm puts global commands in %APPDATA%\npm (for example C:\Users\YOUR-NAME\AppData\Roaming\npm). The Node.js installer adds that folder to PATH, which is why node-red works afterwards.
3. Start Node-RED and Open the Editor
node-redNode-RED prints a startup log. When you see Server now running at http://127.0.0.1:1880/, open http://localhost:1880 in your browser. Keep the terminal window open: closing it stops Node-RED.
The log also shows two useful paths:
- User directory:
C:\Users\YOUR-NAME\.node-red, where your flows, settings and installed nodes live. - Flows file:
flows.jsonin that folder, named after your PC on older versions.
The first time, Windows Defender Firewall may ask whether Node.js can use the network. If you only use the editor on this PC, you can cancel. Allow Private networks only if you want phones or other computers on your home network to reach it, and in that case set a password first (step 5).
To use a different port, start it with node-red -p 1881.
4. Test It with a First Flow
- Drag an inject node from the palette onto the workspace.
- Drag a debug node next to it.
- Wire the inject node's output to the debug node's input.
- Click Deploy (top right).
- Open the Debug sidebar (the bug icon) and click the square button on the left of the inject node.
A timestamp appears in the Debug sidebar. The editor, the runtime and a flow are all working, and you haven't needed an ESP32 or a broker yet. To go further with this flow, the first flow guide adds a function node and explains msg.payload.
5. Add Nodes, Secure the Editor and Back Up
Install extra nodes
Open the menu (☰, top right) → Manage palette → Install, search, and click Install. Popular first choices:
| Package | Adds |
|---|---|
@flowfuse/node-red-dashboard | Dashboard 2.0: buttons, sliders, gauges, charts |
node-red-node-serialport | Serial in/out nodes for an Arduino on a COM port |
node-red-contrib-influxdb | Write sensor data to InfluxDB |
MQTT nodes are built in; you only need a broker. On Windows, the Mosquitto installer from mosquitto.org runs as a service, or you can use a broker on a Raspberry Pi.
Password-protect the editor
By default anyone who can reach port 1880 can edit your flows. Before allowing network access, add a login. Generate a password hash:
node-red admin hash-pwThen edit C:\Users\YOUR-NAME\.node-red\settings.js, find the commented adminAuth section, uncomment it and paste the hash:
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "PASTE-THE-HASH-HERE",
permissions: "*"
}]
},Restart Node-RED and the editor asks for a login. Never expose port 1880 to the internet, even with a password; use a VPN or a secured reverse proxy instead. More in Securing Node-RED: HTTPS, MQTT TLS and backups.
Back up your flows
Everything lives in %USERPROFILE%\.node-red. Copy that folder before upgrading or moving to another PC. Exporting single flows works too: Menu → Export → Download. Exported flows don't include credentials, which is what you want when sharing.
Stop, restart and update
Press Ctrl+C in the terminal to stop Node-RED; run node-red to start it again. To update, stop it and run npm install -g --unsafe-perm node-red@latest. To uninstall, run npm uninstall -g node-red (your .node-red folder stays until you delete it).
Start Node-RED automatically at log-on
An npm install doesn't create a Windows service. For a learning PC, Task Scheduler is the simplest option:
- Open Task Scheduler → Create Task.
- Triggers tab: New → At log on, for your user.
- Actions tab: Start a program, program
cmd.exe, arguments/c node-red. - Conditions tab: untick Start the task only if the computer is on AC power on a laptop.
- Save, sign out and back in, then open http://localhost:1880.
For a true background service, tools such as PM2 or NSSM can run Node-RED without a console window. For an always-on home automation hub, a Raspberry Pi uses far less power than a PC left running; see installing Node-RED on a Raspberry Pi 5.
Node-RED on Windows vs a Raspberry Pi
| Windows PC | Raspberry Pi | |
|---|---|---|
| Best for | Learning, prototyping, building flows | Running flows 24/7 |
| Power draw | Tens of watts or more | A few watts |
| Starts on boot | Needs Task Scheduler, PM2 or NSSM | Built-in service |
| GPIO pins | No | Yes |
A common pattern is to build flows on Windows, export them, and import them on a Pi for the permanent setup.
Troubleshooting
| Problem | Fix |
|---|---|
| npm.ps1 / node-red.ps1 cannot be loaded because running scripts is disabled | Use Command Prompt instead of PowerShell, or run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once |
| node or npm is not recognized | Open a new terminal; if it persists, repair Node.js with PATH enabled |
| node-red is not recognized | Check %APPDATA%\npm is on PATH; npm list -g --depth=0 shows whether it installed |
| Error: listen EADDRINUSE: address already in use :::1880 | Node-RED is already running in another window, or another app has port 1880; close it or use node-red -p 1881 |
| Browser can't open localhost:1880 | The Node-RED terminal was closed or showed an error; start it again and read the log |
| A palette node fails to install | Read the first npm error in the log; check Node.js is a supported version and you're online |
| Other devices can't reach the editor | Firewall blocked Node.js; allow it on Private networks, and set a password first |
| Flows disappeared after an update | You started Node-RED with a different user directory; check the User directory line in the log |
To see which program holds port 1880:
netstat -ano | findstr :1880
tasklist /FI "PID eq 1234" # replace 1234 with the PID from the first commandPrepare a Node-RED flow for dependable use
A flow that works once in the editor is a good first milestone. Before leaving it running, check what happens when Windows restarts, the network drops, a device disconnects or a node receives an unexpected message.
Check the runtime and flow after a restart
After installing Node-RED, note the Node.js and Node-RED versions shown by the terminal. Use a supported Node.js LTS release for the Node-RED version you installed; compatibility requirements can change between major releases, so check the current Node-RED installation documentation before upgrading. Avoid upgrading Node.js, Node-RED and every palette node at the same time on a working system. Back up the user directory first, then change one layer and test the flow.
For a flow that reads sensor data, add a Debug node while developing and inspect the complete message, not only msg.payload. Confirm the payload type and units. A number such as 24.6 and a string such as "24.6" can behave differently in a Function or Switch node. Validate required fields before using them, and route malformed messages to a Catch node or a dedicated error path.
Handle disconnects and repeated messages
IoT devices reconnect. A broker may deliver a retained message when a flow starts, and a publisher using QoS 1 may deliver a duplicate. Design the flow so repeated updates do not accidentally trigger repeated physical actions. For commands, use explicit desired states and check the current reported state before issuing another action. Add a timeout or status indicator when a device stops reporting, rather than assuming the last value is still current.
Use a Status node to observe connection changes from MQTT and other nodes that expose status. A Catch node can collect node errors, while a complete error-handling path should log enough information to identify the failing node and message without printing credentials or personal data.
Back up and restore deliberately
Before changing palette packages or settings, stop the runtime and copy the entire .node-red user directory to a separate location. This includes flows, credentials storage, settings and installed-node metadata. Keep the backup somewhere other than the same disk if the flow is important. Exporting a flow is useful for sharing, but it is not a full backup: credentials are intentionally excluded, and environment-specific settings may still need to be recreated.
After a restore, start Node-RED locally, inspect the startup log for missing nodes, open the editor and verify each important flow. Test with a simulated message before reconnecting real relays or motors. If a flow controls hardware, make sure the device itself starts in a safe state even when Node-RED is offline.
Keep the editor private
The editor is an administration interface, not a public dashboard. Bind it to localhost if only the PC needs access. If another trusted device on the LAN must reach it, use a private network, restrict Windows Firewall to that network profile and configure editor authentication. Do not forward port 1880 directly from your router to the internet. For remote access, use a VPN or a properly secured reverse proxy with HTTPS and access control.
FAQ
Do I need Node.js before Node-RED? Yes. Node-RED is an npm package, so Node.js and npm come first.
Is Node-RED free? Yes, it's open source under the Apache 2.0 licence.
Which Node.js version should I use? The current LTS. Node-RED 4.x needs Node.js 18 or newer.
Where are my flows saved on Windows? In C:\Users\YOUR-NAME\.node-red, in flows.json.
Can Node-RED on Windows talk to an ESP32 or Arduino? Yes. An ESP32 usually connects over MQTT or HTTP; an Arduino over USB with the serial nodes. See Control an ESP32 LED with Node-RED and MQTT and Node-RED with Arduino serial sensor data.
Can I run Node-RED in Docker on Windows? Yes, with Docker Desktop and the nodered/node-red image, but the npm install above is simpler for learning.
What to Do Next
Work through the series in order:
- Node-RED nodes, flows and msg.payload
- Your first flow: inject, function and debug
- Node-RED with MQTT and Mosquitto
- Dashboard 2.0: buttons, switches and gauges
- Control an ESP32 LED with Node-RED and MQTT
Official references: Node-RED on Windows and Securing Node-RED.




