Update Time:2025-07-25

How to install Node-RED on a Raspberry Pi?

Install Node-RED on your Raspberry Pi with the official script. Follow these steps to set up, start, and access Node-RED for your automation projects.

Components & Parts

install Node RED on a Raspberry Pi

You can put node-red on your raspberry pi by using the official install script in your terminal. Many people use node-red for things like home automation, watching things in real time, and industrial IoT. Some common uses are:

  • Setting up home automation for lights, sensors, and alarms.

  • Watching system resources like CPU temperature and disk space.

  • Connecting with industrial devices using MQTT or Modbus.

  • Making dashboards for live data from your node-red program.

This guide helps you install node-red, even if you have never done it before.

Key Takeaways

  • Update your Raspberry Pi first. This helps stop errors and keeps it safe.

  • Use the official Node-RED install script. It sets up Node-RED, Node.js, and npm with the right versions.

  • Start Node-RED with easy commands. You can open its editor in a web browser on your Raspberry Pi or other devices.

  • Make Node-RED start by itself when you turn on your Raspberry Pi. This way, your projects keep running without you doing anything.

  • If you have problems installing or running Node-RED, check the logs. Follow tips to fix any issues you find.

Prerequisites

Raspberry Pi Requirements

Before you start the installation, you need to make sure your raspberry pi meets the basic requirements. Node-RED works well on many models, but you get the best experience with newer hardware. Here are the recommended specs:

You also need to use raspberry pi os. The Bullseye version is the current supported release for Node-RED. Both 32-bit and 64-bit raspberry pi os Bullseye versions work with the official installation script. If you use the 32-bit version, Node-RED might already be installed. On the 64-bit version, you can install Node-RED using the script.

💡 Tip: Make sure your raspberry pi connects to the internet. You will need this connection to download node.js, npm, and other packages during installation.

You should also have node.js and npm ready. Node-RED depends on node.js to run and uses npm to manage extra packages. If you do not have node.js yet, the installation script will help you install node.js and npm.

System Update

You should always update your raspberry pi before you install new software. This step helps prevent errors and keeps your system secure. To update your raspberry pi os, open a terminal and run:

sudo apt update && sudo apt upgrade -y

This command updates the package list and upgrades all installed packages. After the update, your raspberry pi will be ready for the Node-RED installation. Keeping your system up to date also helps node.js and npm work smoothly with the latest features.

Install Node-RED

Installation Script

You can install node-red on your Raspberry Pi using the official installation script. This script comes from the trusted GitHub repository called "node-red/linux-installers." The script helps you set up everything you need for node-red, including node.js and npm. You do not have to worry about removing old versions or missing packages. The script takes care of these steps for you.

To start, open a terminal on your Raspberry Pi. Then, run the following command:

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

This command downloads and runs the official installation script. Here is what the script does:

  1. Updates your Raspberry Pi system packages.

  2. Removes any old versions of node-red and node.js to avoid problems.

  3. Installs the latest version of node.js using the NodeSource repository.

  4. Installs npm, which helps you manage extra node-red modules.

  5. Installs the latest version of node-red.

  6. Adds Raspberry Pi specific modules for node-red.

  7. Sets up node-red as a system service so it can start automatically when you turn on your Raspberry Pi.

📝 Note: The official script is the best way to install node-red. It gives you the latest features and makes sure everything works together. The script also sets up npm, which you need for adding new nodes and features to node-red.

After you run the script, you will have a fresh and working node-red setup. You can follow these node-red installation instructions every time you want to install node-red on a new Raspberry Pi.

Node.js Compatibility

Node-red needs node.js to run. The latest version of node-red works best with newer versions of node.js. You should use a version that is in the Long Term Support (LTS) phase. The script will install node.js for you, but you can also choose a specific version if you need it for your project.

Here is a table that shows which node.js versions work with different node-red versions:

Node-RED VersionMinimum Node.js Version
4.x18
3.x14
2.x12

The latest version of node-red supports node.js 20.x, which is the recommended choice in 2024. You should avoid odd-numbered node.js versions because node-red does not test them as much. If you ever upgrade node.js, you should rebuild your node-red nodes to make sure everything works.

💡 Tip: If you want to install a different version of node.js, you can set the --node14, --node16, --node18, or --node20 flag when you run the installation script. For example, to install node-red with node.js 18, use:

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18

You now know how to install node-red and make sure it works with the right version of node.js. This setup gives you a stable and up-to-date system for your projects.

Start Node-RED

node-red-start Command

You can start node-red on your Raspberry Pi in a few simple steps. The main command you use is node-red-start. This command launches the node-red server and keeps it running in the background. Even if you close the terminal, node-red will keep working. You can also use the node-red-pi command with extra options to control memory use, which helps if your Raspberry Pi has less RAM.

Here is a table that shows the main commands for starting node-red:

CommandWhat It Does
node-red-startStart node-red server and keep it running in the background
node-red-pi --max-old-space-size=256Start node-red with limited memory usage (good for small Raspberry Pi models)
Desktop Menu > Programming > Node-REDStart node-red from the Raspberry Pi desktop menu

You can also set node-red to start automatically when you turn on your Raspberry Pi. To do this, run:

sudo systemctl enable nodered.service

This command makes sure the node-red server starts every time your device boots up.

Access Web Editor

After you start node-red, you can access node-red using a web browser. The node-red server runs on port 1880 by default. You can open the editor on your Raspberry Pi by typing http://127.0.0.1:1880 in your browser. If you want to use another computer on the same network, use your Raspberry Pi’s IP address like this: http://<ip-address>:1880.

Follow these steps for accessing node-red editor:

  1. Start node-red by running node-red-start in the terminal.

  2. Look at the terminal output. It will show the address for the node-red editor.

  3. Open a web browser and enter the address shown, such as http://127.0.0.1:1880.

  4. To access node-red from another computer, use your Raspberry Pi’s IP address with port 1880.

  5. You can now use the node-red editor to build your flows.

You can change the port if you need to configure node-red settings. Edit the uiPort value in the settings.js file in the .node-red folder. This lets you run node-red on a different port if 1880 is busy.

🛡️ For better security, you can set up a username and password or use HTTPS. You can also limit who can access node-red by changing the settings or using a firewall.

Autostart Node-RED on Boot

Setting up node-red to start by itself is helpful. It makes sure your projects keep running all the time. When you turn on your Raspberry Pi, node-red will start right away. This is important for home automation and IoT projects. Your flows and dashboards will always be ready. Node-red is light and does not use much power. It runs in the background and connects with things like MQTT and web dashboards.

Enable Systemd Service

You can use systemd to make node-red start on boot. Follow these steps to set it up:

  1. Open a terminal and make a new systemd service file:

    sudo nano /lib/systemd/system/nodered.service
    
    
  2. Put this text in the file:

    [Unit]
    Description=Node-RED
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/node-red
    Restart=on-failure
    KillSignal=SIGINT
    SyslogIdentifier=node-red
    
    [Install]
    WantedBy=multi-user.target
    
    
  3. Save the file and close the editor.

  4. Reload systemd so it sees the new service:

    sudo systemctl daemon-reload
    
    
  5. Turn on the node-red service to start on boot:

    sudo systemctl enable nodered.service
    
    

When you finish these steps, node-red will start every time your Raspberry Pi turns on. This keeps your automation flows working and reliable.

Manage Node-RED Service

You can use systemd commands to control node-red. Here are some common things you can do:

  • Start node-red by hand:

    sudo systemctl start nodered
    
    
  • Stop node-red:

    sudo systemctl stop nodered
    
    
  • Check if node-red is running:

    sudo systemctl status nodered.service
    
    
  • Reload systemd after you make changes:

    sudo systemctl daemon-reload
    
    

If node-red stops soon after starting, check your Raspberry Pi OS version. The 64-bit Bullseye version works best with node-red. Always update your system before you install or manage node-red. This helps stop errors and keeps your projects running well.

When you set up node-red to start on boot, your Raspberry Pi will always run your flows. Even if you restart or lose power, your automation will keep working. This gives you peace of mind and helps you control your devices all the time.

Troubleshooting Installation

Common Issues

When you install node-red on your Raspberry Pi, you might run into some problems. Many users see errors because of mixing up npm commands, using the wrong permissions, or having the wrong version of Node.js. Here are some common issues you might face:

  • You see errors about missing or broken symbolic links for commands like node-red-start.

  • The node-red-start command is not found after installation.

  • You get permission errors when installing node-red or extra nodes.

  • npm gives warnings about missing package.json files or shows errors like ENOTEMPTY.

  • You notice version mismatches between node-red and Node.js.

  • The install script fails if you use a virtual machine or unsupported system architecture.

  • Network problems can stop node-red from downloading needed files, especially if your Raspberry Pi has both WiFi and Ethernet connected.

💡 Tip: Always use the official Raspberry Pi install script for node-red. This script helps avoid most common mistakes and sets up everything for you.

If you see errors about node-red not starting or missing commands, try these steps:

  • Check your Node.js and npm versions. Use versions that node-red supports.

  • Clean up any old or partial installations before running the script again.

  • Make sure you run the install script as the right user, not with sudo unless told.

  • If you have both WiFi and Ethernet, disconnect one or set the right network priority.

Checking Logs

You can find out why node-red is not working by checking the logs. When you start node-red from the terminal, you see real-time messages about what is happening. These logs show errors, warnings, and other important details.

  • If you start node-red with node-red-start, watch the terminal for error messages.

  • If you run node-red as a service, use this command to see the logs:

    journalctl -u nodered -f
    
    
  • For more details, look at the install log at /var/log/nodered-install.log. This file shows what happened during installation and helps you find the exact error.

  • Sometimes, you see errors like EJSONPARSE or EACCES in the logs. These mean there is a problem with a package file or permissions.

You can also use the debug node in node-red to send messages to the console and the debug tab. If you need longer debug messages, change the debugMaxLength setting in the settings.js file. After you change this, restart node-red to see the new settings.

🛠️ If you cannot solve the problem, search for the error message online or ask for help in the Raspberry Pi or node-red forums. Many users have solved similar problems and can offer advice.

You can set up node-red on your raspberry pi by following these main steps:

  1. Update your system with sudo apt-get upgrade.

  2. Run the node-red install script.

  3. Confirm the install when asked.

  4. Start node-red from the menu or terminal.

  5. Open the node-red editor in your browser.

  6. Enable node-red to start on boot if you want.

  7. Use node-red commands to manage your service.

Node-red lets you build smart projects and connect devices easily. Try out the editor, explore flows, and see what you can create.

If you want to learn more, check out these resources:

FAQ

How do you update Node-RED to the latest version?

Open your terminal and run the official install script again. This script will update Node-RED and Node.js if needed. You do not need to uninstall anything first.

Can you install extra nodes or modules in Node-RED?

Yes, you can add new nodes using the "Manage palette" option in the Node-RED editor. You can also use the terminal and run npm install <node-module> inside your .node-red folder.

What should you do if Node-RED will not start?

Check your Node.js version and make sure it matches Node-RED’s requirements. Run node -v in the terminal. If you see errors, look at the logs with journalctl -u nodered -f.

Is it safe to use Node-RED on your home network?

Node-RED is safe if you set a strong password and keep your Raspberry Pi updated. You can also enable HTTPS for better security. Avoid exposing Node-RED directly to the internet.

 

 

 

 


 

Written by Jack Elliott from AIChipLink.

 

AIChipLink, one of the fastest-growing global independent electronic   components distributors in the world, offers millions of products from thousands of manufacturers, and many of our in-stock parts is available to ship same day.

 

We mainly source and distribute integrated circuit (IC) products of brands such as BroadcomMicrochipTexas Instruments, InfineonNXPAnalog DevicesQualcommIntel, etc., which are widely used in communication & network, telecom, industrial control, new energy and automotive electronics. 

 

Empowered by AI, Linked to the Future. Get started on AIChipLink.com and submit your RFQ online today! 

 

 

Share:
How to install Node-RED on a Raspberry Pi? - AIChipLink