1 - Introduction Installation Node-RED
1 - Introduction Installation Node-RED
Node-RED is a programming tool for wiring together hardware devices, APIs and online services in
new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of
nodes in the palette that can be deployed to its runtime in a single-click.
Features
1. Browser-based flow editing
2. Built on Node.js
3. Social Development
Get Started
Node-RED is built on Node.js, taking full advantage of its event-driven, non-blocking model. This makes
it ideal to run at the edge of the network on low-cost hardware such as the Raspberry Pi as well as in
the cloud.
This guide will help you get Node-RED installed and running in just a few minutes.
Pick where you want to run Node-RED, whether on your local computer or Raspberry Pi and follow
the guides below.
Node-RED provides a browser-based flow editor that makes it easy to wire together flows using the
wide range of nodes
Prerequisites
To install Node-RED locally you will need a supported version of Node.js. Node-RED currently
recommends Node 16.x LTS.
Introduction & Installation Node-RED | Ahmad Fauzi Firmansyah
This tutorial will guide you through the very quick process of installing NodeJS 16. This command will
add PPA sources required to be able to install NodeJS 16 on your linux installation:
Now that the PPA source has been added, we can install NodeJS 16 on your linux installation. Run the
following command:
Once the installation is complete, we're ready to confirm the version installed. Finally, let's confirm
the installed version. Run the following command:
To install Node-RED you can use the npm command that comes with node.js:
That command will install Node-RED as a global module along with its dependencies. You can confirm
it has succeeded if the end of the command output looks similar to:
Running
Once installed as a global module you can use the node-red command to start Node-RED in your
terminal. You can use Ctrl-C or close the terminal window to stop Node-RED.
You can then access the Node-RED editor by pointing your browser at http://localhost:1880
Node-RED uses flows_<hostname>.json as the default flows file. You can change this by providing the
flow file name as argument to the node-red command.
Introduction & Installation Node-RED | Ahmad Fauzi Firmansyah
Upgrading Node-RED
If you have installed Node-RED as a global npm package, you can upgrade to the latest version with
the following command:
2. Running on Windows
This page gives specific instructions on setting up Node-RED in a Microsoft Windows environment.
The instructions are specific to Windows 10 but should also work for Windows 7 and Windows Server
from 2008R2. It is not advisable to use versions prior to Windows 7 or Windows Server 2008R2 due to
lack of current support.
Install Node.js
Download the latest 16.x LTS version of Node.js from the official Node.js home page. It will offer you
the best version for your system.
Run the downloaded MSI file. Installing Node.js requires local administrator rights; if you are not a
local administrator, you will be prompted for an administrator password on install. Accept the defaults
when installing. After installation completes, close any open command prompts and re-open to ensure
new environment variables are picked up.
Introduction & Installation Node-RED | Ahmad Fauzi Firmansyah
Once installed, open a command prompt and run the following command to ensure Node.js and npm
are installed correctly.
Install Node-RED
Installing Node-RED as a global module adds the command node-red to your system path. Execute the
following at the command prompt:
Running on Windows
Once installed, the simple way to run Node-RED is to use the node-red command in a command
prompt: If you have installed Node-RED as a global npm package, you can use the node-red command:
C:>node-red
This will output the Node-RED log to the terminal. You must keep the terminal open in order to keep
Node-RED running.
Note that running Node-RED will create a new folder in your %HOMEPATH% folder called .node-red.
This is your userDir folder, think of it as the home folder for Node-RED configuration for the current
user. You will often see this referred to as ~/.node-red in documentation. ~ is shorthand for the user
home folder on Unix-like systems. You can use the same reference if using PowerShell as your
command line as recommended. If you are using the older cmd shell, that won’t work.