0% found this document useful (0 votes)
70 views5 pages

1 - Introduction Installation Node-RED

Node-RED is a programming tool that allows users to visually wire together hardware devices, APIs, and online services. It provides a browser-based flow editor where users can drag-and-drop nodes to create flows. Flows can be deployed with a single click. Node-RED is built on Node.js and is ideal for running on low-cost hardware like Raspberry Pi as well as in the cloud. The document provides instructions for installing Node-RED locally or on a Raspberry Pi and getting started.

Uploaded by

Irwan Wahyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views5 pages

1 - Introduction Installation Node-RED

Node-RED is a programming tool that allows users to visually wire together hardware devices, APIs, and online services. It provides a browser-based flow editor where users can drag-and-drop nodes to create flows. Flows can be deployed with a single click. Node-RED is built on Node.js and is ideal for running on low-cost hardware like Raspberry Pi as well as in the cloud. The document provides instructions for installing Node-RED locally or on a Raspberry Pi and getting started.

Uploaded by

Irwan Wahyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Introduction & Installation Node-RED | Ahmad Fauzi Firmansyah

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

Node-RED provides a browser-based flow editor


that makes it easy to wire together flows using the
wide range of nodes in the palette. Flows can be
then deployed to the runtime in a single-click.

JavaScript functions can be created within the


editor using a rich text editor.

A built-in library allows you to save useful functions,


templates or flows for re-use.

2. Built on Node.js

The light-weight runtime 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.

With over 225,000 modules in Node's package


repository, it is easy to extend the range of palette nodes
to add new capabilities.
Introduction & Installation Node-RED | Ahmad Fauzi Firmansyah

3. Social Development

The flows created in Node-RED are stored using JSON


which can be easily imported and exported for
sharing with others.

An online flow library allows you to share your best


flows with the world.

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.

1. Running Node-RED locally

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:

url -s https://deb.nodesource.com/setup_16.x | sudo bash

Now that the PPA source has been added, we can install NodeJS 16 on your linux installation. Run the
following command:

sudo apt install nodejs -y

Once the installation is complete, we're ready to confirm the version installed. Finally, let's confirm
the installed version. Run the following command:

node --version && npm –version

You should receive back output that looks similar to:

Installing with npm

To install Node-RED you can use the npm command that comes with node.js:

sudo npm install -g --unsafe-perm node-red

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

The log output provides you various pieces of information:

• The versions of Node-RED and Node.js


• Any errors hit when it tried to load the palette nodes
• The location of your Settings file and User Directory
• The name of the flows file it is using.

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:

sudo npm install -g --unsafe-perm node-red

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.

Using Powershell: node --version; npm --version

Using cmd: node --version && npm --version

You should receive back output that looks similar to:

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:

npm install -g --unsafe-perm node-red

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.

You might also like