You have probably heard about Node-RED and which is one of the most popular tool in IOT revolution. It’s an open-source flow based visual programming tool for wiring the components as a part of Internet of Things. It allows developers at any level to rapidly connect physical IO, cloud-based systems, databases and most APIs in any combination you can imagine.
Node-red can be installed and run on very small hardware machines e.g. Raspberry PI, TinkerBoard etc.
Today we will provide step by step guide to install Node-RED 0.20.x on Ubuntu 18.04 LTS x86_64 (64 bit) Operating system.
Step 1: Update your system
Update the package lists for upgrades for packages that need upgrading, as well as new packages that have just come to the repositories.
$ sudo apt-get update
$ sudo apt-get upgrade -y
Step 2: Install Node.js and npm
$ sudo apt-get install nodejs
It is recommended to check the version of Node.js before proceeding. The versions Node.js LTS 8.x or 10.x is recommended. Node-RED does not support Node.js 6.x or earlier.
To check the version of Node.js installed, use the following command:
$ node -v
OR
$ node --version
Now we have the prerequisites installed, let’s install Node-RED.
Step 4: Install Node-RED
$ sudo npm install -g --unsafe-perm node-red node-red-admin
-g | This means that the package is installed globally and it will be available for Node.js |
–unsafe-perm | This overrides any errors during the time of installation. Basically the user/group ID switching is suppressed when a package script is run, non-root users will be able to install packages. |
Node-red-admin | This will install the admin module providing us with some additional administration tools for Node-RED. |
Step 5: Test your installation
Node-RED uses the port :1880 as its default port. So, lets allow the port to be used by the service by using the following command:
$ sudo ufw allow 1880
So now we are all set and can start using Node-RED.
Open a terminal (Ctrl+Alt+T) and type the following command:
$ node-red
You can open any browser installed on your system and hit the url bar with the following address:
http://localhost:1880