How to install Node-Red Ubuntu 22.04

How can I install Node-Red
I've made several attempts, but it doesn't work.
Not via Github, and not via the Node-Red site.
Anyone have an idea
Greetings from Holland

Welcome to the forums @edwin

Just try the provided install script.

  1. Make sure you're not running as root (but the user can do sudo - it will be prompted for)
  2. make sure you have curl installed.
  3. run the below.
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18
  1. run sudo systemctl enable nodered && sudo systemctl start nodered

You should now have a running Node RED (using Node v 18) <- edit the version if you want in the shell command

Explanation performed, but cannot start Node-Red.
Still an error

it will be great if you can translate the output (or maybe not post images at all - it doesn't help us)

But - You have installed nvm it does nothing, but makes things difficult, and causes problems.

I (and most here) do not use nvm - so if you know how to remove its traces, do so and try again, and if still problems , paste (not screenshot) the output.

OR
if you are in a position to do so, re-image the server, and do nothing but use the install script.

  • under an account that can do sudo (but don't login as root)

I can confirm what Marcus has said, as I have 2 Oracle cloud servers, each running Ubuntu 22.04, and simply running the install script had node-RED up and running in minutes.

2 Likes

Thanks @cymplecy (I blame the Ale) :smile:

?????????

:joy:

He corrected a typo of mine Noting -> Nothing

(i'm surprised he found only 1, I is clever you know)

2 Likes

One question mark would have sufficed, but discourse insisted I type 9...!

1 Like

To be honest, the 4 exclamation marks are fine! :wink:

Sorry, but I don't quite understand what you mean.
My English isn't great, that's why I work with a translator.
I don't see a solution yet on how to install Node-Red.
And how can I translate the output to you??
How can I remove nvm??

Wat ik bedoel is: plak geen schermafbeeldingen, omdat we de fout daarin niet kunnen vertalen. Plak in plaats daarvan de uitvoer van de terminal, zodat deze kan worden vertaald.

Hoe dan ook.

De reden dat ik denk dat u problemen ondervindt, is te wijten aan het feit dat NVM is geĂŻnstalleerd en dit een puinhoop heeft gemaakt van uw Node JS.

Als je niet weet hoe je het netjes moet verwijderen (we gebruiken NVM niet - dus ik ben niet helemaal zeker van het proces), zou ik ervoor kiezen om de Ubuntu-server misschien te resetten/opnieuw te imagen, en weg te blijven van NVM, en installeer NodeJS en Node RED met het onderstaande.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18

What I mean is, don't paste screenshots, as we can't translate the error within. Instead paste the output of the terminal - so it can be translated.

Anyway.

The reason I believe you're having issues, is due to the fact NVM has been installed, and this has made a mess of your Node JS.

If you do not know how to cleanly remove it (we don't use NVM - so not sure of the process fully), I would opt to maybe reset/re-image the Ubuntu server, and stay away from NVM, and install NodeJS and Node RED with the below.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --node18

EDIT
het vraagt ​​je om nvm use lts uit te voeren, dus misschien voer je dat uit voordat je de installatie probeert uit te voeren? maar persoonlijk zal ik het gewoon wissen, als je kunt.

it is asking you to run nvm use lts, so maybe run that before trying to run the install? but personally, i will just wipe it, if you can.

Thanks for the translation.
I'll see how I can remove nvm.
My PC ran 24/7 for 3 years and stopped working last week. Now I am reinstalling everything on a new PC, including Node-Red.
Find out how I can remove nvm

I was able to remove nvm and then install Node-Red.
When starting Node-Red I see this in the terminal.

edwin@edwin-450-101nd:~$ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.1.118:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a systemd service.
Jan 21 15:29:17 - [info]
Welcome to Node-RED

21 Jan 15:29:17 - [info] Node-RED version: v3.1.3
Jan 21 15:29:17 - [info] Node.js version: v18.19.0
Jan 21 15:29:17 - [info] Linux 5.15.0-91-generic x64 LE
Jan 21 15:29:18 - [info] Loading palette nodes
Jan 21 15:29:18 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
Jan 21 15:29:18 - [info] Settings file : /home/edwin/.node-red/settings.js
Jan 21 15:29:18 - [info] Context store : 'default' [module=memory]
Jan 21 15:29:18 - [info] User directory : /home/edwin/.node-red
Jan 21 15:29:18 - [warn] Projects disabled : editorTheme.projects.enabled=false
Jan 21 15:29:18 - [info] Flows file : /home/edwin/.node-red/flows.json
Jan 21 15:29:18 - [info] Creating new flow file
Jan 21 15:29:18 - [warn] Using unencrypted credentials
21 Jan 15:29:18 - [error] Unable to listen on http://127.0.0.1:1880/
Jan 21 15:29:18 - [error] Error: port in use
nodered.service: Main process exited, code=exited, status=1/FAILURE
nodered.service: Failed with result 'exit code'.
nodered.service: Consumed 1.345s CPU time.

I can go to the http number and node-red has started.
The error message keeps repeating.

just type this.

sudo systemctl enable nodered.service

And reboot.

You do not need to start Node RED your self after - you might be trying to start node red yourself when you don't need to - its already running

i.e

Jan 21 15:29:18 - [error] Error: port in use

In other words - Node RED is already running

Thank you. Command executed and system rebooted
Indeed Node-Red not started via terminal
Node-Red has already started. Super thanks

1 Like

Great!

Stay away from node version managers (i.e nvm) - they (normally) interferer with the running environment .

Hi,

I'm running my Node-Red instances as well on Ubuntu but using docker for that.

In my opinion it makes it easier to managed the resources.

Additionally, I/m runnung multiple Node-red instances on my Ubuntu with no problem (so far(
1 x PROD Node-Red instance
2 x TEST/Development Node-Red instances

1 Like

Hi Nexus,
I have never worked with Docker before.
I'm afraid that's too complicated for me.
Too much in English, and then too much has to be translated into Dutch
I'm just happy that I can just use Ubuntu.

1 Like

I agree with that, don't use Docker unless you have a good reason, or are already familiar with using Docker.

1 Like