How to Get Start with Node-RED installation

Greetings readers, today we thought to share the Node-RED installation steps which can help you in setting it up in 10 minutes. It’s one of the most trending tools for Internet of Things applications and is being widely used to monitor the communication between the IoT devices. Software developers or the IT enthusiasts can easily download it and follow the Node-RED installation steps given here.

Built with node js support, Node-RED is a leading GUI application and platform independent interface engineered by IBM for linking the Internet of Things. Though, IBM has already contributed it to the Open Source community. IBM presented an open invitation to the developers of the world to add their customization into Node-RED.

What is Node-RED?

Node-RED as its name reflects was developed using Node.js framework to bring out a light-weight and browser oriented user interface. It comes with a highly interoperable design which allows it to link both physical and digital type of things together.

Node-RED Sample Workflow.

For using Node-RED one doesn’t need to be a seasoned programmer. Software engineers with less coding expertise can also contribute to the growth of this field. Most of the programming tasks in Node-RED, you can do visually using the pre-defined function nodes. You can perform drag and drop operation on these nodes and place them on canvas to create the desired workflow. Also, it supports new functionality with the help of JavaScript files.

Node-RED doesn’t entirely replace the need for writing the code but significantly helps in reducing the development efforts. It enables the developers to focus on creating earth-shattering applications rather than duplicating efforts by writing the same code over and over again.

Node-RED supports event-based mechanism which makes it very easy to control the interconnection between multiple hardware. It is portable with all leading web browsers to allow easy formation of the functional workflows related to Internet of Things. The light-weight nature of this application enables it to run on smaller devices like the BeagleBone and Raspberry Pi.

Let’s start the Node-RED installation.

Now we’ll demonstrate the steps to get started with Node-RED. We’ll be using the Ubuntu 14.04 server for Node-RED installation. There are a few main configuration steps which you need to perform before it ‘s ready to run on your setup.

1- Setup Node.js before Node-RED installation.

1.1- Installing Node.js.

The very first item to install is <Node.js>. It’s a JavaScript based ultra light-weight development platform which is getting popular day-by-day.

Node-RED works with Node.js version 0.10.x and 0.12.x. Hence, we’ll download and install the latest <Node.js> version. So, open up a terminal window. Press CTRL+T to launch the terminal or select the terminal option from the desktop menu.

Note: Make sure you should log in as a root user, or you will use <sudo> if running as a standard user.

1.2- Removing the previous Node.js version.

You can skip these steps if you are installing Node.js for the first time. Else run the below commands to remove a previous Node.js installation.

Shell

1

2

3

4

$dpkg--get-selections|grepnode

techbeamers-node install

node install

If you find any previous “node” installed then run the following command to wipe it out entirely.

Shell

1

$sudo apt-getremove--purge node

1.3- Perform the Node.js installation.

In the next set of instructions, we’ll run commands to install the latest version of Node.js.

Here is the command which will install and add node js support.

Shell

1

$sudo apt-getinstall node.js

After setting up node js server, move to install the Node Package Manager i.e. <npm>, run the below command.

Shell

1

$sudo apt-getinstall npm

Create a symbolic link with the name as “node” for “node.js“. It’s a standard term which many Node.js tools use frequently.

Shell

1

$sudo ln-s/usr/bin/nodejs/usr/bin/node

Test the Node.js installation by executing the following commands:

Shell

1

2

3

4

5

$node-v

v4.2.6

$npm-v

3.5.2

2- Configuring Node-RED.

2.1- Setting up Node-RED.

We have successfully configured Node.js, and can now jump on to downloading the Node-RED. The latest Node-RED version can be fetched from its GIT repository so that we can work on its most recent version updated with any new commits.

To download from GIT, you must make sure that you have the GIT package installed. If it is not there, run the following command to get the GIT running on your system.

Shell

1

$sudo apt-getinstallgit-core

After successfully installing GIT, navigate to your home directory to continue with the Node-RED installation.

We’ll now list out the steps that you’ll need to run for Node-RED.

1- First, clone the Node-RED repository, and then install it using the <npm> command.2- NPM is the Node Package Manager that we’d earlier set up during the Node.js installation.

Shell

1

2

3

4

$cd~

$git clonehttps://github.com/node-red/node-red.git

$cdnode-red

$sudo npm install

2.2- Starting Node-RED server.

Now we have come to the point where you are just a shot away from testing your first bit with Node-RED. Just double-check that you are still in the </home/node-red/> directory and set off the following command.

Shell

1

$sudo node red.js

The above command would release a lot of information onto the screen. You could see a few errors about missing packages and obviously the success messages. To verify that Node-RED is running, locate the following line in the console log.

Shell

1

Node-REDavailableon the default1880port...

Now we are all set to open the Node-RED session into the browser. Open your default browser and type the following URL to see the Node-RED blazing.

Shell

1

http://localhost:1880

You’ll see an empty workspace opening in the browser window with the default but functional “nodes” tiled on the left side of the screen. Start playing around with the drag and drop feature to link the nodes together.

Final Thought.

Hopefully, this article will help you in kick-starting the Node-RED tool on Ubuntu. Do write to us about the topic of your interest, we’ll add it to our writing roadmap.

In the next article, we’ll present you with a short <init.d> script to <start/stop> the Node-RED server and manage it as a service.

Welcome Meenakshi, please do perform these steps and let me know how it goes for you. Though I’ve myself validated all these instructions on my test bed.
I welcome readers like you who post such valuable feedback. Thanks!