What you will build
A Raspberry Pi 5 can run Node-RED as an always-on home server for IoT projects, sensor dashboards, MQTT messaging and automation. Node-RED runs on the Pi itself; from your Windows PC, Mac or Linux computer, you use a web browser to open the editor and build flows. You do not need a monitor, keyboard or mouse permanently connected to the Pi.
This guide covers installation on Raspberry Pi OS, enabling the service to start after every reboot, finding the Pi's local IP address, connecting from your PC, and checking that everything works. It also explains common connection problems and the security steps worth taking before using Node-RED for real hardware.
You need: Raspberry Pi 5, a reliable power supply, microSD card or other boot drive, current Raspberry Pi OS, internet access during setup, and a PC on the same trusted local network. Raspberry Pi OS Lite is suitable for a headless installation.
1. Prepare Raspberry Pi OS
Install a current Raspberry Pi OS release using Raspberry Pi Imager. Raspberry Pi OS Lite is a good choice for a headless server because it avoids installing a desktop; the full desktop edition also works. During imaging, set a hostname you can recognize, create a user and strong password, configure Wi-Fi if needed, and enable SSH if you want to administer the Pi from your PC.
After booting, open a terminal on the Pi or connect through SSH. Update the package lists and installed packages:
sudo apt update
sudo apt full-upgrade -y
If core packages or the kernel were updated, reboot and reconnect:
sudo reboot
Keep the Pi connected to the internet while installing Node-RED. If you are using Wi-Fi, confirm the Pi has joined the correct network rather than a guest network that isolates devices. Ethernet is often simpler for a device intended to run continuously.
Tip: write down the username and hostname you configured. You will need the username for SSH and the hostname or IP address to reach the Pi later.
Optional: manage the Pi from your PC with SSH
If you want to run commands without connecting a monitor and keyboard, enable SSH in Raspberry Pi Imager during OS setup. If the Pi is already configured, enable SSH from the Raspberry Pi OS settings or the sudo raspi-config utility. Only enable remote access on a network you trust, and keep the system updated.
On your PC, open Windows Terminal, PowerShell, macOS Terminal or a Linux terminal and connect using your Pi username and hostname or IP address:
ssh [email protected]
Replace your-username and raspberrypi.local with your actual username and hostname. If local hostname resolution fails, use the Pi IP address instead, for example ssh [email protected]. After logging in, you can run the installation, service and diagnostic commands in this guide from that terminal. SSH is for command-line administration; the Node-RED editor itself opens separately in a browser at http://PI-IP-ADDRESS:1880.
2. Install Node-RED on Raspberry Pi 5
Use the official Node-RED installer for Debian-based systems. It checks the Node.js environment, installs Node.js 22 LTS if none is found (an existing Node.js must be at least v20), installs Node-RED, and configures a service for background operation. This avoids piecing together Node.js and Node-RED installation steps from unrelated guides.
On a minimal image, install the build tools npm may need first: sudo apt install build-essential git curl. Then run this command in a Bash-compatible terminal on the Pi:
bash <(curl -sL https://github.com/node-red/linux-installers/releases/latest/download/install-update-nodered-deb)
Read the prompts and let the installer finish. The script is maintained by the Node-RED project; you can inspect the script and available options in its official repository before running it. If the Pi already has a custom Node.js or Node-RED setup, review the installer's behavior first because it may update or replace existing installations.
When it finishes, check the installed tools:
node --version
npm --version
npm list -g node-red --depth=0
Exact version numbers change over time. Each command should return a version rather than “command not found.” If a command is missing, do not immediately install another Node.js package over the top; review the installer output and resolve that installation first.
The official installer is the preferred path for a typical Raspberry Pi OS setup. Advanced users with manually managed Node.js installations should check the current Node-RED installation documentation for their chosen environment.
Important before upgrading: the official installer removes an existing Node-RED version before installing the current one. Back up your flows and settings first (commonly the .node-red directory for the account running Node-RED). Review the official Raspberry Pi installation guide if you already have a custom Node.js or Node-RED setup.
3. Start Node-RED and verify the service
Start Node-RED using the helper installed by the setup script. It starts the background service and prints its log; pressing Ctrl+C or closing the terminal does not stop the service, and node-red-log re-attaches to the log:
node-red-start
Then check the system service:
systemctl status nodered.service
Look for an active/running state. The status screen may open a pager; press q to return to the terminal. You can also request a short status line with:
systemctl is-active nodered.service
If Node-RED is not running, inspect its logs before trying repeated restarts:
node-red-log
Logs can reveal missing modules, permission problems, configuration errors or port conflicts. The official installer normally creates nodered.service, so a custom service file is not usually necessary. If the service name is missing, review whether the installer completed successfully and consult its output rather than creating a second service blindly.
4. Enable automatic startup after reboot
Starting Node-RED manually does not always mean it is enabled to start each time the Pi powers on. Enable the systemd service:
sudo systemctl enable nodered.service
Ensure it is running now as well:
sudo systemctl start nodered.service
Verify the startup and runtime states:
systemctl is-enabled nodered.service
systemctl is-active nodered.service
Expected output is enabled and active. The first command checks whether systemd is configured to start the service at boot; the second checks whether it is running right now. They answer different questions, so check both if you are troubleshooting.
Test autostart rather than assuming it works
Reboot the Pi:
sudo reboot
Wait for it to return to the network, then open the editor from your PC using the address in the next section. If the editor loads without manually running node-red-start, autostart is working.
If the service is enabled but fails after reboot, inspect systemctl status nodered.service and node-red-log. A service can be enabled but still fail because of a configuration error, a missing module or a port conflict.
To disable boot startup later, use sudo systemctl disable nodered.service. To stop it immediately, use node-red-stop or sudo systemctl stop nodered.service.
5. Find your Raspberry Pi's IP address
Your PC needs the Pi's hostname or local IP address. Run these commands on the Pi:
hostname
hostname -I
The first prints the hostname; the second lists assigned IP addresses. Choose the address on your home or office LAN, for example 192.168.1.42. This is only an example—your router may use a different address range. If several addresses appear, do not choose a Docker, VPN or other virtual interface address by mistake.
If you cannot access a terminal, open your router's connected-device list and look for the hostname you configured. A local hostname such as raspberrypi.local may work, depending on your PC operating system and network. If it does not resolve, use the IP address instead.
For a stable address, consider creating a DHCP reservation in your router. This tells the router to give the Pi the same local IP address each time it connects, making it easier for your PC and other IoT devices to find it. The menu names vary by router, and a DHCP reservation is usually preferable to manually setting an address that might conflict with another device.
6. Open the Node-RED editor from your PC
Connect the PC and Raspberry Pi to the same trusted local network. Open a browser on the PC and enter the Pi's IP address followed by port 1880:
http://192.168.1.42:1880
Replace the example IP with the one returned by hostname -I. If hostname resolution works on your network, you can try http://raspberrypi.local:1880 instead.
The Node-RED runtime runs on the Pi; your PC browser is simply the interface for building, editing and deploying flows. You do not need to install Node-RED on the PC, and closing the browser does not stop the background service.
If the page will not load, check systemctl is-active nodered.service on the Pi, verify the IP address, and make sure both devices are on the same network. Guest Wi-Fi and router client-isolation settings may block local connections. Confirm that you typed :1880 and check logs if the service is active but the editor still does not respond.
Security warning: the default editor may not require a login. Treat it as a powerful control interface. Keep port 1880 on a trusted LAN; do not forward it directly from your router to the public internet. Configure editor authentication and HTTPS before allowing access beyond a trusted network.
7. Build your first visible flow: Inject → Function → Debug
Now that the editor opens, build a flow that changes a message and shows a clear result. You will use three core nodes:
- Inject starts the flow when you click its button and sends a test message.
- Function runs a small piece of JavaScript to transform that message.
- Debug displays the result in the Debug sidebar.
Step 1: Add and connect the nodes
Drag one Inject, one Function and one Debug node onto the workspace. Connect them in this order:
[Inject: "hello"] → [Function: add a greeting] → [Debug: msg.payload]
Double-click the Inject node. Set its payload type to string and its value to hello, then click Done. Open the Function node and replace its code with:
msg.payload = `SolderHub says: ${msg.payload}!`;
return msg;
Click Done, then open the Debug node and choose msg.payload as the output if that option is shown. Click Deploy to apply the flow.
Step 2: Run it and check the result
Open the Debug sidebar, then click the small button on the Inject node. You should see this text:
SolderHub says: hello!
That visible change confirms the message travelled through all three nodes. Inject sent hello; Function replaced msg.payload with a formatted greeting; Debug displayed the new payload. The Function returns msg so the message can continue to the next node. If you omit return msg, this simple flow will not pass the result to Debug.
Step 3: Experiment
Change the Inject payload to Raspberry Pi 5, deploy again and click Inject. The output should become SolderHub says: Raspberry Pi 5!. You can also add a second Debug node to inspect the complete message, or change the Function to add a property such as msg.source = "first-flow" before returning the message.
If nothing appears: deploy your latest edits, make sure the nodes are wired in the correct order, confirm the Debug node is enabled, and open the Debug sidebar. Check the Function node for syntax errors and its status indicator. This working flow is a useful baseline before connecting MQTT, an HTTP endpoint or an ESP32; troubleshoot new integrations separately instead of reinstalling Node-RED immediately.
8. Troubleshooting common problems
The installer fails or a command is missing
Confirm that the Pi has internet access and that sudo apt update completed. Read the installer output to identify the failing step. If Node.js or Node-RED was already installed manually, check for conflicting versions before running more installation commands.
The editor does not open from the PC
Check systemctl status nodered.service and inspect node-red-log. Run hostname -I again and use the correct LAN address. Include :1880 in the browser URL. Make sure the PC is not connected to a guest Wi-Fi network that blocks local-device traffic. If the PC is on a VPN, temporarily test on the local network without the VPN if your security policy permits.
Node-RED works until the Pi reboots
Check systemctl is-enabled nodered.service. If it says disabled, enable it with sudo systemctl enable nodered.service, then start the service. If it is already enabled, inspect the logs for errors that occur during boot. Remember that enabled means configured for boot, not necessarily running successfully.
Port 1880 is already in use
Another Node-RED process or application may be listening on the default port. Check service status and logs before stopping anything. Avoid running multiple Node-RED instances against the same user directory because they can conflict over flow files and configuration. If you intentionally run multiple instances, configure separate user directories and ports.
The hostname does not work
.local name resolution varies by operating system and network. Use the IP address as a fallback. A DHCP reservation can help if the IP changes often.
Node-RED loads but the browser shows a connection warning or login prompt
A login prompt may mean authentication has been configured, which is good. Use the credentials you set rather than disabling security. Do not bypass browser or network warnings by exposing the editor publicly; set up trusted HTTPS and authentication if remote access is genuinely required.
9. Useful commands for day-to-day management
| Task | Command |
|---|---|
| Start Node-RED | node-red-start |
| Stop Node-RED | node-red-stop |
| View logs | node-red-log |
| Check service status | systemctl status nodered.service |
| Check whether it is running | systemctl is-active nodered.service |
| Enable startup at boot | sudo systemctl enable nodered.service |
| Disable startup at boot | sudo systemctl disable nodered.service |
| Restart the service | sudo systemctl restart nodered.service |
| Restart with the helper | node-red-restart |
| Stop, then start | node-red-reload |
Use these commands to manage the service without needing to keep the editor open. If you update Node.js, Node-RED or contributed nodes, verify that the runtime starts cleanly and that your important flows still work.
10. Security and reliability tips
- Keep the editor on a trusted network. Do not expose port 1880 directly to the public internet or create a router port-forward for it.
- Configure authentication. If other people or networks can reach the editor, configure Node-RED editor authentication. Use HTTPS for access over networks you do not fully trust.
- Use a VPN for remote access. A properly configured VPN is generally safer than opening the editor port to the internet. Keep authentication and firewall restrictions in place as well.
- Keep Raspberry Pi OS updated. Schedule updates carefully if the Pi runs important automations, and verify the service after maintenance.
- Protect flows and credentials. Back up your Node-RED user directory, commonly
~/.node-redfor the service user. Review how credentials are stored before sharing flow exports. - Use reliable power and storage. A suitable Pi 5 power supply and safe shutdown practices reduce the risk of interruptions or storage corruption.
- Test hardware flows carefully. Node-RED can operate relays, motors, heaters and other equipment. Use appropriate electrical isolation and fail-safe defaults; do not rely on a flow alone as the only safety mechanism.
For the full configuration steps, see the official Node-RED security guide.
Frequently asked questions
Does the Raspberry Pi 5 need a monitor?
No. Raspberry Pi OS Lite and SSH are enough for headless operation. You can use the editor from another computer's browser.
Does my PC need Node-RED installed?
No. Node-RED runs on the Pi. Your PC only needs a browser and network access to the Pi's editor.
Will Node-RED start after a power cut?
After power returns and the Pi boots successfully, an enabled systemd service should start Node-RED. A power cut can still cause storage or hardware problems, so use reliable power and safe shutdown practices.
Can I access the editor when I am away from home?
Do not expose port 1880 directly to the internet. Use a properly secured VPN or carefully configured HTTPS reverse proxy with authentication and firewall restrictions.
Which port does Node-RED use?
The editor normally uses TCP port 1880. Custom configurations can change it, but the default URL uses that port.
How do I know whether autostart is enabled?
Run systemctl is-enabled nodered.service. enabled means systemd is configured to start it at boot. Run systemctl is-active nodered.service separately to check whether it is running now.
Conclusion
Your Raspberry Pi 5 can now run Node-RED as a background service, start it automatically after reboot, and host an editor that you open from a PC browser. The essentials are the official installer, sudo systemctl enable nodered.service, the Pi's LAN address, and port 1880.
Before relying on it for automation, reboot once to test autostart, deploy the Inject-to-Debug flow, and make sure the editor is not exposed to untrusted networks.
Related SolderHub guides
- Control an ESP32 LED with Node-RED and MQTT — a hands-on project to build once your Pi is running Node-RED.
- Node-RED Tutorial for Beginners: Nodes, Flows & msg.payload — understand messages and build your first flow.
- Raspberry Pi 5 Pinout: GPIO, RP1, and What Actually Changed from the Pi 4 — identify GPIO pins before connecting hardware.
Official resource: Node-RED on Raspberry Pi.