# Alternate-node-red-installer

**URL:** <https://discourse.nodered.org/t/alternate-node-red-installer/81172>\
**Category:** General\
**Created:** [10 September 2023 08:35 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172 "2023-09-10T08:35:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 08:35 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/1 "2023-09-10T08:35:34Z")

</div>

Hello, today i try the alternate-node-red-installer by TotallyInformation. My goal at the end is, to have different instances with the same version of node-red. aner later use nginx to manage it all

Unfortnely i cant get it run. I (tried) to follow this guide [https://github.com/TotallyInformation/alternate-node-red-installer/blob/master/README.md](https://github.com/TotallyInformation/alternate-node-red-installer/blob/master/README.md).  
I am pretty sure i missunderstand some things

1. I used nrinstall -f ~/nrtest. Now i have a folder /home/user/nrtest. There i have a subfolder called data. But what now? i am kinda confused how to create now multiple instances with different ports.

Should i create a new folder /home/user/nrtest/node-red-1881 and run in this folder `npm install --unsafe-perm --production node-red` ?

Sorry i am to dumb to understand this guide.

---

<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:** [10 September 2023 09:16 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/2 "2023-09-10T09:16:04Z")

</div>

If all the node red instances use the same version of node red then you don't need the alternate installer. You can start node red using command line parameters to tell it where to get its flows and settings file and what port to use. Not at my computer so can't confirm exactly what, but probably this will tell you  
`node-red --help`

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 September 2023 09:21 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/3 "2023-09-10T09:21:08Z")

</div>

The normal NR installer creates one instance in a .node-red folder

The alternate installer lets you create extra instances - all of them separate from each other and not sharing things like settings or version numbers

So, I don't think alternate installer is what your looking for - Colin's advice looks the way forward for you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 September 2023 09:33 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/4 "2023-09-10T09:33:03Z")

</div>

What @cymplecy and @Colin state are correct, you can create multiple instances simply by providing the correct command line options. There are even threads on the forum detailing how you can do this.

An alternative to consider is using a tool that does it all for you from a web based frontend. There are several out there, one such offering is FlowFuse.

Take 5 mins and watch this [Why FlowFuse](https://www.youtube.com/watch?v=KOnQnR7yfT0) video.

If you think it could be useful for you to have a single web based portal for stopping, starting, creating all your node-reds, then go ahead and give it a go. It's free if you install it yourself!

There are multiple options for you to chose. Here are the 2 simplest options

- Install it and run it yourself (it is open source, just like Node-RED): [Local Install • FlowFuse Docs](https://flowfuse.com/docs/install/local/)
- Or you can skip all that and just dive straight in to a ready made, secured FlowFuse environment (just sign up): [FlowForge](https://app.flowforge.com/account/create)

_Full disclosure, I work for FlowFuse (and I am a Node-RED core developer too)._

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 09:40 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/5 "2023-09-10T09:40:14Z")

</div>

Thank you.

I know that this multiple instances was discussed very often. But i still dont get it quiet well.

I know that there are parameters that will point to a dir and/or to a port.

For example: home/user/.node-red (created through the „original“ script)  
home/user/.node-red-1881

So i can start node red pointing to dir. .node-red and port 1880 AND start another instance  
pointing to .node-red-1881 and port 1881

(To make it boot on start is another question, but i am not there yet)

Is it enouth to just copy .node-red directory and name it node-red-1881. and there i change the settings.js to the right port (here 1881)?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 September 2023 09:46 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/6 "2023-09-10T09:46:16Z")

</div>

> [@Manuel\_o](#):
>
> Is it enouth to just copy .node-red directory

There is no need to copy the `.node-red` directory. Just create the 2nd node-red directory and start node-red with the right command line and node-red will create the new instance and a brand new `settings.js` for you.

> [@Manuel\_o](#):
>
> and there i change the settings.js to the right port (here 1881)?

If you want to! but it is not really necessary if you set the port in the command line.

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 09:57 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/8 "2023-09-10T09:57:24Z")

</div>

thank you all.

So i can use bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)) to create node red as my main instance.

than (in there) i can copy the settings.js, name it for example settings1881.js.

now i have in there 2 settingsfiles: settings.js and settings1881.js.

> I then editied settings1881.js and changed the name of the flows file

Can you help me here a bit more please. I guess u changed uiPort: process.env.PORT || 1880, to uiPort: process.env.PORT || 1881 (for emxample).  
What do you mean with "changes the name of the flow files"

thank you

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 September 2023 10:02 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/9 "2023-09-10T10:02:57Z")

</div>

> [@Manuel\_o](#):
>
> So i can use bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)) to create node red as my main instance.

Not quite. This installs the core of node-red. You dont have any instances until you start node-red.

> [@Manuel\_o](#):
>
> than (in there) i can copy the settings.js, name it for example settings1881.js.

This is NOT necessary.

> [@Manuel\_o](#):
>
> Can you help me here a bit more please. I guess u changed uiPort: process.env.PORT || 1880, to uiPort: process.env.PORT || 1881 (for emxample).

No, dont do that.

See this: [Node red multiple instances - #7 by Steve-Mcl](https://discourse.nodered.org/t/node-red-multiple-instances/9787/7)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [10 September 2023 10:06 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/10 "2023-09-10T10:06:56Z")

</div>

Ignore me - follow @Steve-Mcl advice - too many cooks spoil the broth 🙂

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 10:24 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/11 "2023-09-10T10:24:25Z")

</div>

thanks again to all for the help.

I try to sum-up what did, maybe this will help another one:

What i ve done now. I used bash \<(curl -sL [https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered](https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)) to install/create the core version of node-red.

Now i have a "main" folder called .node-red. So far so good.  
Now i created a second folder .node-red-1881.

From my undertanding, nothing is running (yet)

I used the command (linux) that u all sugested:  
node-red -p 1880 -u /root/.node-red  
AND  
node-red -p 1881 -u /root/.node-red-1881

again. from my understanding and like steve mentioned, there should now 2 independent instances of node red.  
And yes, i can confirm that there are 2 versions now.

My plan now:  
Since the instances are only runnig as long my shell is opened i (you) now have to make node-red running in the backround and on start up.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 September 2023 10:53 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/12 "2023-09-10T10:53:23Z")

</div>

> [@Manuel\_o](#):
>
> node-red -p 1880 -u /root/.node-red

Why are you using `root`?  
What platform are you running on? (Pi?, Windows? Mac?)

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 10:58 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/13 "2023-09-10T10:58:19Z")

</div>

I am on a VM (Debian)

best regards

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 11:19 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/14 "2023-09-10T11:19:04Z")

</div>

to start multiple insnaces start on startup, is there a specifc guide to fullfill this you yould recommend?

thank you

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 September 2023 11:34 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/15 "2023-09-10T11:34:40Z")

</div>

Have you read the documentation [Running on Raspberry Pi : Node-RED](https://nodered.org/docs/getting-started/raspberrypi)?  
Take a look at the `Running as a service` section and see if that will work for you.

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 13:47 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/16 "2023-09-10T13:47:50Z")

</div>

thank you.

Yes i know how to settle it at reboot for 1880. I always used:  
sudo systemctl enable nodered.service

I struggle to find the bridge for all other ports. I tried to copy the nodered.service file and name it nodered1881.service, but i am lost on how to continue.

best regards

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [10 September 2023 14:36 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/17 "2023-09-10T14:36:39Z")

</div>

For everyone thah has the same trouble as me:

I followed this guide. I am now able to have 2 instances and run them as a service on boot:

> **[Node-Red multiple instances, RPi](https://pysselilivet.blogspot.com/2019/04/node-red-multiple-instances-rpi.html)**
>
> Updated 2022-07, Node-Red instances multiple many several dashboards systemd settings.js uiPort flowFile nodered.service

Now i am trying to marry nginx with it.

---

<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:** [11 September 2023 09:23 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/18 "2023-09-11T09:23:36Z")

</div>

> [@Manuel\_o](#):
>
> My goal at the end is, to have different instances with the same version of node-red

As the others have said, the alt installer isn't actually needed for this. Rather, it allows you to have totally intependent versions of node-red running in their own folder structures and without the need to install globally (which requires sudo and can have negative security implications in a production service).

If you want the best of both worlds (a single instance of Node-RED source plus the local install benefits), that can also be done with the alt installer. All you need is to create more than just the `data` folder that was created for you. For example, you could create a `data-prod` and `data-dev` folder. Then you can copy the systemd startup script and change the parameters to use the different userDir folder and port.

> [@Manuel\_o](#):
>
> later use nginx to manage it all

NGINX can be used as a reverse proxy in either case.

> [@Manuel\_o](#):
>
> I used nrinstall -f ~/nrtest. Now i have a folder /home/user/nrtest. There i have a subfolder called data. But what now?

That is a completely encapsulated instance of Node-RED and the data sub-folder is the `userDir` folder that in a default Node-RED installation would be at `~/.node-red`. Just change the port number if you already have an existing node-red instance running. There is an example settings.js file that you can use that somewhat expands and improves on Node-RED's default file giving you more options on doing things like setting ports using environment variables.

To run it, you should see an npm script that lets you do `npm start` to run up the instance manually. There is an example systemd script included that you can link across into your systemd scripts area, just change it to your own needs. It should be well documented inside the script. That example script includes the optional link to a local environment file - that will set env variables at startup - so again, you can control things like the Node-RED port there. The file lives in the same folder structure so that, again, it doesn't have to be edited using sudo.

> [@Manuel\_o](#):
>
> Should i create a new folder /home/user/nrtest/node-red-1881

No, you don't need any other folders. That is the purpose of the alternate installer. It creates a fully encapsulated installation of Node-RED without needing sudo or other admin privileges or other folders. All in 1 place for ease of backup, copy, etc.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 September 2023 09:37 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/19 "2023-09-11T09:37:54Z")

</div>

> [@TotallyInformation](#):
>
> > [@Manuel\_o](#):
> >
> > Should i create a new folder /home/user/nrtest/node-red-1881
> 
> No, you don't need any other folders. That is the purpose of the alternate installer. It creates a fully encapsulated installation of Node-RED without needing sudo or other admin privileges or other folders. All in 1 place for ease of backup, copy, etc.

In context, the OP is referring to the `userDir` not the core node-red install code. To have multiple instances that dont "interfere" with each other, then separate `userDir`s are required\*.

\*require: yes, the OP could have multiple settings files and individually named flows etc but the node modules would be shared - that sounds cool & all, but it can be a headache when a) some nodes are not needed in other instance and updating nodes require all instances to restart.

---

<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:** [11 September 2023 09:39 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/20 "2023-09-11T09:39:02Z")

</div>

> [@Steve-Mcl](#):
>
> In context, the OP is referring to the `userDir` not the core node-red install code. To have multiple instances that dont "interfere" with each other, then separate `userDir`s are required\*.

Yes, I know. I covered both in my reply. See "If you want the best of both worlds ..."

---

<div class="post-metadata">

**Author:** ![Manuel\_o](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@Manuel\_o](https://discourse.nodered.org/u/Manuel_o)\
**Post date:** [12 September 2023 08:59 UTC](https://discourse.nodered.org/t/alternate-node-red-installer/81172/21 "2023-09-12T08:59:58Z")

</div>

Thanks again. with all of your help, i managed it to get  
multiple instances that are SSL certificated and are managed by nginx.

I will write a guide how i did it for future references

[Next page](https://discourse.nodered.org/t/alternate-node-red-installer/81172.md?page=2)
