IMD SolutionComputing LibraryShop main store

How-to

Install Node-RED Natively on a Linux Edge Computer

Edge computing and IIoT Published 5 min read

Short answer

Install Node-RED directly on the Debian-based edge computer rather than in Docker: give the login account sudo, install build-essential, git and curl, then run Node-RED's official Debian install script and start the runtime without the -v flag. The script installs Node.js, npm and Node-RED and registers a systemd service, so the runtime also starts at boot.

On this page
  1. What does a native Node-RED install need before you begin?
  2. How do you give the edge account sudo access?
  3. Which packages does the install script need first?
  4. How do you run the Node-RED Debian install script?
  5. What if you installed Node.js through nvm instead?
  6. Why does node-red -v not start Node-RED?
  7. How do you fix a node install that fails with "not found"?
  8. How do you know the installation succeeded?
  9. Questions asked

Install Node-RED directly on the Debian-based edge computer, not in a container: give the login account sudo rights, install the build dependencies the script expects, run the install script Node-RED publishes for Debian-class systems, and start the runtime without the -v flag. The script installs Node.js, npm and Node-RED and registers the runtime as a systemd service, so the box comes back up collecting data after a power cycle. This is the documented native path, and nothing in it needs Docker.

What does a native Node-RED install need before you begin? #

You need a Debian-based distribution on the edge computer, one login account with sudo rights, and network access to the package repositories; the script itself brings Node.js, npm and Node-RED, so no separate runtime download is required.

Node-RED documents one install script for the Raspberry Pi that runs on any Debian-based operating system, which covers the fanless edge boxes and gateways deployed on plant networks. The standard installation is global — installed once for every user of the machine — and that is why administrator rights are a prerequisite rather than an option. A supported Node.js release is the other prerequisite; the script selects one, so the version question only matters if you install Node.js yourself. On an unattended box, use the script and let it own the versions: hand-pinning runtimes is for when a specific flow demands it.

How do you give the edge account sudo access? #

Open a root shell, install sudo through apt, add the account to the sudo group, then log out and back in — four steps, and a full reboot is not one of them.

  1. Open a root shell with su - and the root password.
  2. Install sudo: apt install sudo.
  3. Add your account to the sudo group: adduser edge sudo, replacing edge with the account you actually log in with.
  4. Log out of the session completely and log back in. Group membership is applied at login, which is the entire point of this step.
  5. Run a harmless command through sudo from that account and confirm it completes without an error.

One deployment added a reboot after step 3 as a precaution; it does nothing the fresh login has not already done. Keep the root shell for installation only — after the install, the runtime runs from the ordinary account.

Which packages does the install script need first? #

Install build-essential, git and curl — three packages on one apt line — before running the script, and verify g++ and python3 are current when your flows use nodes that compile native code, for five names covered in total.

sudo apt install build-essential git curl

The arithmetic for a fully prepared box: 3 packages the script names plus 2 tool names for native nodes equals 5, or 3 + 2 = 5. g++ is part of the toolchain build-essential brings in, so that check usually passes on sight; python3 is the one most likely to be absent. Install only what an error names — never blanket-install a toolchain for a node that has not failed yet.

How do you run the Node-RED Debian install script? #

Take the current one-line script command from Node-RED's official Raspberry Pi installation page and run it from the sudo-enabled account; the same script works on any Debian-based distribution, not only on a Raspberry Pi.

Go to that page for the command because it changes between releases, and a command copied from a forum post or a cached guide is how stale installs happen. The script installs Node.js, npm and Node-RED, and on Debian-like systems it installs the runtime as a systemd service — the operating system then starts Node-RED at boot with no init work on your side. That service wiring is the practical reason to prefer the script on an edge box over a manual install.

What if you installed Node.js through nvm instead? #

Log out and back in once after installing nvm so a fresh login shell loads its environment; on recent nvm versions the session you installed it in cannot see the Node.js it manages.

If node or npm cannot be found in the same session where nvm was just installed, the fix is the new login, not a reinstall. This behavior is reported for recent nvm releases and older ones may differ, but a fresh login costs nothing on either, so take it regardless.

Why does node-red -v not start Node-RED? #

Because on current versions the -v flag makes the command print version information and exit — run plain node-red, with no flag, to start the runtime.

node-red -v   # prints the version, does not start
node-red      # starts the runtime

Older Node-RED releases may still have started with the flag, which is why stale guides show it. The distinction matters for verification: a version printed to the console proves the binary is installed, not that the runtime is running.

How do you fix a node install that fails with "not found"? #

Read the whole error, find the named "not found" item, install exactly that missing dependency, and retry — most node installation failures on a freshly built box are one missing package, not a broken Node-RED.

  1. Save or scroll the full error text; the missing executable, header or package is named inside it, usually in a line containing "not found".
  2. Install that one item through apt, nothing more.
  3. Retry the node installation from the palette.

If the failing node compiles native add-ons or calls Python tooling, that is the moment to confirm g++ and python3 are current — the two names from the dependency check above.

How do you know the installation succeeded? #

Confirm three things: the account can run a command through sudo, node-red -v prints a version, and node-red starts the runtime with no unresolved dependency error — all three, not any one.

The first proves the account can maintain the machine, the second proves the install completed, and the third proves the runtime actually runs; treating a version query as a successful start is the common false pass. After those three, power-cycle the box once: with the service the script registered, Node-RED should come up on its own, and that is the last thing to verify before you call the edge computer production-ready.

Questions asked

Does the script work on very old Debian releases?

Node-RED's Raspbian packaging scripts cover Stretch and Buster, and the last Node-RED release packaged for the older Jessie release was 0.15.3. On a box still running a release that old, plan an operating-system upgrade instead of the script; a 0.15.3-era runtime is years behind on fixes and node compatibility.

Is there a documented install path without the script?

Yes. Node-RED's local install documentation gives one: install a supported release of Node.js yourself, then run sudo npm install -g node-red. The -g makes it a global install for every user of the machine, which is why it needs administrator rights too. You give up the automatic systemd service, so weigh that before choosing it on an unattended box.

Will the same script run on DietPi?

Yes. The script is documented for any Debian-based operating system, and DietPi is one of the named examples, so treat it like any other Debian-class box: a sudo-enabled account, the three build packages, then the script.

Can the whole install be done as root instead of setting up sudo?

It can, but you would then install and later run everything from a root shell. The standard install needs admin rights either way because it is global; one sudo-enabled account delivers the same result while the runtime keeps running under the ordinary login. Set sudo up once and use it.

Keep reading

Auto restart Node-RED in Docker after exit code 255