Skip to content

Latest commit

 

History

History
144 lines (88 loc) · 3.18 KB

guide_node-red.rst

File metadata and controls

144 lines (88 loc) · 3.18 KB
.. author:: Sven <[email protected]>
.. tag:: lang-nodejs
.. tag:: web
.. tag:: programming

Logo

Node-RED

.. tag_list::

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.


Prerequisites

We're using :manual:`Node.js <lang-nodejs>` in the stable version 20:

[isabell@stardust ~]$ uberspace tools version use node 20
Using 'Node.js' version: '20'
Selected node version 20
The new configuration is adapted immediately. Patch updates will be applied automatically.
[eliza@dolittle ~]$

Your domain needs to be setup:

Installation

Use npm to install node-red globally.

[isabell@stardust ~]$ npm install -g --unsafe-perm node-red
[...]
+ [email protected]
added xx package in yys

Configuration

Setup daemon

Create ~/etc/services.d/node-red.ini with the following content:

[program:node-red]
command=node-red
autostart=yes

If it's not in state RUNNING, check your configuration.

Configure web server

Note

Node-RED is running on port 1880. Additionally, the --remove-prefix parameter is needed if you want to run Node-RED under a sub URI like /nodered instead of the root URI /.

Node-RED can now be accessed via https://isabell.uber.space/.

Securing

Note

By default, Node-RED is accessible by everyone without a password!

At least, an admin and editor password should be set as described in the Node-RED documentation (https://nodered.org/docs/user-guide/runtime/securing-node-red#editor--admin-api-security). The configuration file is located at ~/.node-red/settings.js.

After changing the configuration, restart Node-RED to reload configuration:

[isabell@stardust ~]$ supervisorctl restart node-red
node-red: stopped
node-red: started
[isabell@stardust ~]$ supervisorctl status
node-red                         RUNNING   pid 21665, uptime 0:00:22
[isabell@stardust ~]$

Updates

Use npm update Node-RED:

[isabell@stardust ~]$ npm update -g node-red
[...]
+ [email protected]
updated 7 packages in 29.546s

Then restart the service:

[isabell@stardust ~]$ supervisorctl restart node-red
node-red: stopped
node-red: started
[isabell@stardust ~]$ supervisorctl status
node-red                         RUNNING   pid 4711, uptime 0:00:42
[isabell@stardust ~]$

Tested with Node-RED 3.1.0, Uberspace 7.15.6

.. author_list::