# How to install node-red from scratch

**URL:** <https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753>\
**Category:** General\
**Created:** [7 March 2020 12:19 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753 "2020-03-07T12:19:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [7 March 2020 12:19 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/1 "2020-03-07T12:19:50Z")

</div>

please can someone give me a basic guide on the correct way to install node-red

every time i create a new linux box (ubuntu,zorin etc) I then have rights issue get node-red and npm install

from a new installation how should i sign in ? and then what are the correct steps to install?

please

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 March 2020 12:39 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/2 "2020-03-07T12:39:54Z")

</div>

If you are using Ubuntu the first yellow box in the docs is where you need to start - [https://nodered.org/docs/getting-started/local](https://nodered.org/docs/getting-started/local)  
aka use the Pi/Debian/Ubuntu install script.  
Or if you want to tidy up first

```auto
sudo apt purge -y nodejs npm
sudo apt update
sudo apt upgrade

```

then run the script

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [7 March 2020 13:57 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/3 "2020-03-07T13:57:23Z")

</div>

thanks  
then i get this!  
"user@zorin:~ sudo npm install -g --unsafe-perm node-red [sudo] password for user: /usr/bin/env: ‘node’: No such file or directory user@zorin:~"

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [7 March 2020 14:42 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/4 "2020-03-07T14:42:56Z")

</div>

are there only certain linux that this works and not all linux work?? its all so confusing!!

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 March 2020 15:00 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/5 "2020-03-07T15:00:26Z")

</div>

zorin is based on ubuntu so you should clean up then try the script. (without sudo)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [7 March 2020 15:44 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/6 "2020-03-07T15:44:58Z")

</div>

The script linked to earlier is this one, but it appears you are manually installing it. You can do that if you like but the script is easier.  
[https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 March 2020 16:14 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/7 "2020-03-07T16:14:55Z")

</div>

Just downloaded a zorin iso - booted as a virtual machine - logged in - ran script - installed fine... all good.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 11:56 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/8 "2020-03-08T11:56:27Z")

</div>

have just try and am getting this

I really need it to run as a service is it possible  
"  
This can take 20-30 minutes on the slower Pi versions - please wait.

Stop Node-RED ✔  
Remove old version of Node-RED ✔  
Using NVM to manage Node.js + please run nvm use lts/\* before running ./node-reds  
NOTE: Using nvm is NOT RECOMMENDED. Node-RED will not run as a service unde nvm.Install Node-RED core  
Update Node.js LTS ✔ Node v12.16.1 Npm 6.13.4  
Clean npm cache ✔  
Install Node-RED core ✔  
Move global nodes to local -  
Install extra Pi nodes ✔  
Npm rebuild existing nodes -  
Add shortcut commands ✔  
Update systemd script ✔/nodered-install.log  
"

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 11:58 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/9 "2020-03-08T11:58:47Z")

</div>

zorin 15 LTE i am using is that what you tested?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 March 2020 12:03 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/10 "2020-03-08T12:03:27Z")

</div>

I just grabbed what was offered - zorin 15.2-Core-64bit I think.  
In your screenshot.. Where did nvm come from ? It isn't installed by default.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 March 2020 12:05 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/11 "2020-03-08T12:05:19Z")

</div>

> [@gbond](#):
>
> I really need it to run as a service is it possible

If you need to set it up manually, check Dave's script for the template or my one here:

[https://github.com/TotallyInformation/alternate-node-red-installer/blob/master/templates/system/node-red.service](https://github.com/TotallyInformation/alternate-node-red-installer/blob/master/templates/system/node-red.service)

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 12:10 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/12 "2020-03-08T12:10:43Z")

</div>

sorry i dont know what you mean by manually a scripts you all seem to talk in a different languge

just a simple set of instruction on how to install from start to finish would be so helpfull

I dont get why you seem to need a user name and password (and sometime a different one for sudo)  
on link  
so just set them all the same

I dont know I will start again and see if I can get zorin 15.2-core-64bit  
and just try using the bash thing!!

Garrath (I dont know but windows seem so much more straight forward)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [8 March 2020 12:27 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/13 "2020-03-08T12:27:16Z")

</div>

> [@gbond](#):
>
> just a simple set of instruction on how to install from start to finish would be so helpfull

OK, you realise that is what Dave's script is don't you? Why not take a look at it so that you understand what it is doing. It is just issuing the commands in order that you would have to do by hand in a terminal. It also checks things that you would otherwise have to work out for yourself.

> [@gbond](#):
>
> I dont get why you seem to need a user name and password (and sometime a different one for sudo)  
> on link so just set them all the same

You _do_ need some basic skills here if you want to set up a server to run home automation. In this case, some basic administration skills.

On any IT system, it is common to have at least 2 different logins (2 user identities). One for administrative stuff (installing software, rebooting, adding new users, etc) and one for user stuff (that cannot do the admin stuff).

It is much preferred to run software services as a "user" rather than as an "administrator" because that is a lot more secure. So we recommend running Node-RED with user credentials. On a Raspberry Pi with the default OS installed, that is simple because it is designed to be simple. There are 2 users. "pi" and "root". Root is the default admin super-user on Linux. It has special powers and you really don't want to use it unless you have to. So Node-RED is run under the "pi" user typically on a Raspberry Pi.

However, the standard install for Node-RED _does_ require admin access because it is installed for _any_ user to use (a so-called "global" installation). In order to do that, we _temporarily_ give admin rights to the normal user. That uses a special command called `sudo`. Confusingly, when using sudo, you give the users password not the root password - that's because you have to give a user permission to use sudo and only root can do that.

Now, if you are not using a Pi or not using the default Rasbian OS (which is based on Debian). You may need to do some more things yourself. Typical Linux installations ask you to set up a standard user account when you install the OS. This becomes the equivalent of the "pi" user. However, it may not have the rights that the pi user gets since most OS installations prefer security over convenience. So you may need to give your user sudo rights and may need to add it to some additional user groups so that it has access to hardware such as USB ports and Bluetooth for example. You will need to read up on the help for your OS to do that.

I've tried to gloss over a load of detail which isn't important to get you going but hopefully that makes more sense as to why there are two different identities and how/when they are used.

> [@gbond](#):
>
> I dont know but windows seem so much more straight forward

Well, mainly it is just different. It also uses similar security concepts but implements them somewhat differently.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 13:30 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/14 "2020-03-08T13:30:43Z")

</div>

yes thanks that is little clearer i'm used to doing everthing as an administrator & dont tend to bother with users so think that is why this seems back to front  
not sure I have really found where you hadle the security in linux (every thing i have seen appear to over complicate it)

I'm happy to stick with the raspberry pi way off doing (if only I know how)

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 13:32 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/15 "2020-03-08T13:32:13Z")

</div>

can you just confirm that "root" is a user like "administrator" and not the root of the directory structure or are you saying its both

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 13:40 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/16 "2020-03-08T13:40:44Z")

</div>

Im go to start again  
once I have the os up and running  
what automated routine should I run to get node-red working & be able to add the npm moddles in

(now installing zorin core)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [8 March 2020 13:57 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/17 "2020-03-08T13:57:42Z")

</div>

Use the command provided here: [https://nodered.org/docs/getting-started/raspberrypi](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 14:00 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/18 "2020-03-08T14:00:40Z")

</div>

just so i am clear  
as soon as i have the working os

i run this command

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

```

as the user and not with the sudo

and it should install with no issues?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [8 March 2020 14:15 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/19 "2020-03-08T14:15:26Z")

</div>

Yes - it will ask for the admin (sudo) password once while it does the install - it will also install the the service for you (but not enable it).  
Once installed if you run `node-red-start` once it will start Node-RED so you can test - but also print out the command you need to type to enable the service to start at boot time. Do that and the next time you boot Node-RED should be automatically running.

---

<div class="post-metadata">

**Author:** ![gbond](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gbond/32/38851_2.png) [@gbond](https://discourse.nodered.org/u/gbond)\
**Post date:** [8 March 2020 14:25 UTC](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753/20 "2020-03-08T14:25:20Z")

</div>

i dont need to put the sudo infront of the command?

[Next page](https://discourse.nodered.org/t/how-to-install-node-red-from-scratch/22753.md?page=2)
