# Running Node-RED on multiple instances but with separate set of flow

**URL:** https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068
**Category:** General
**Created:** [29 July 2021 08:12 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068 "2021-07-29T08:12:55Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 08:12 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/1 "2021-07-29T08:12:56Z")

</div>

Hello everyone, sorry that I have to make another post again. So currently I've worked on making a interface where user have to login through dashboard and I've set a default persistent content on my main port.

The question is, if multiple user tried connected to the same port i.e. 1880, it'll keep overwriting each other's data on the flow in context data. From what I've read ([Node red multiple instances](https://discourse.nodered.org/t/node-red-multiple-instances/9787)), running Node-RED on multiple instances would work.

After importing the exact flow into a different port i.e. 1881, the dashboard shows nothing and I can't bring up the side menu to see what other groups do I have in that.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8fa6058b1bd108b2db0df12107c8a0184f8ad99b.png)

Are there any other workarounds that I can try? Thanks in advance

---

<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: [29 July 2021 08:25 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/2 "2021-07-29T08:25:08Z")

</div>

If you follow the below you will have separate instances with separate flows and separate dashboards etc...

> [@Node red multiple instances](https://discourse.nodered.org/t/node-red-multiple-instances/9787/7):
>
> assuming windows (you didnt specify)... Create 4 folders... c:\node-red-1880 c:\node-red-1881 c:\node-red-1882 c:\node-red-1883 (avoid 1883) c:\node-red-1884 open 4 cmd windows Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} Start \>\> Run \>\> cmd \>\> {enter} In cmd1... node-red -p 1880 -u c:/node-red-1880 In cmd2... node-red -p 1881 -u c:/node-red-1881 In cmd3... node-red -p 1882 -u c:/node-red-1882 In cmd4... node-red -p 1884 -u c:/no…

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 08:26 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/3 "2021-07-29T08:26:54Z")

</div>

Yea I did the exact thing, but the dashboard is not showing the content of the widget as shown in the original post.

Sorry maybe I should also mentioned that I'm running this on windows.

---

<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: [29 July 2021 08:56 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/4 "2021-07-29T08:56:00Z")

</div>

Open your browser dev tools and look at the console to see if you have any errors.

Those instructions miss something off as well. When creating the new folders, you then should copy across some files from your original if you are wanting to use the same flow. You will also need to run `npm install` in each folder after you have copied the basic files unless you have copied over the `node_modules` folder (which is best avoided as it takes a long time to copy).

Personally, I would have at least 5 instances. Keeping at least one as a master/test bed and creating a script that copies the flows (and possibly creds) and the package.json to each of the user instance folders. The script would need to adjust the starting port of course.

For the master, I would actually have maybe a 6th instance that uses a local install of Node-RED (see my alternate installer repo for an example). That gives you the ability to test your flows on a different version of Node-RED.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 09:02 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/5 "2021-07-29T09:02:23Z")

</div>

> Those instructions miss something off as well. When creating the new folders, you then should copy across some files from your original if you are wanting to use the same flow. You will also need to run `npm install` in each folder after you have copied the basic files unless you have copied over the `node_modules` folder (which is best avoided as it takes a long time to copy).

I'll take a look on that, how do i run `npm install` to that specific folder tho?

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 09:10 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/6 "2021-07-29T09:10:48Z")

</div>

After trying to copy and paste the original folder into the new instances. It still has the same problem with the dashboard. The browser console log shows this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/46921505a7755494a9b96283a25ee3aa574fd011.png)

The cmd shows something like this as well

```auto
C:\Users\weeseong.hew>node-red -p 1881 -u c:/node-red-1881
29 Jul 17:26:00 - [info]

Welcome to Node-RED
===================

29 Jul 17:26:00 - [info] Node-RED version: v2.0.2
29 Jul 17:26:00 - [info] Node.js version: v12.20.2
29 Jul 17:26:00 - [info] Windows_NT 10.0.19042 x64 LE
29 Jul 17:26:02 - [info] Loading palette nodes
29 Jul 17:26:06 - [info] Dashboard version 2.30.0 started at /ui
29 Jul 17:26:07 - [info] Settings file : c:\node-red-1881\settings.js
29 Jul 17:26:07 - [info] Context store : 'default' [module=localfilesystem]
29 Jul 17:26:07 - [info] User directory : c:\node-red-1881
29 Jul 17:26:07 - [warn] Projects disabled : editorTheme.projects.enabled=false
29 Jul 17:26:07 - [warn] Flows file name not set. Generating name using hostname.
29 Jul 17:26:07 - [info] Flows file : c:\node-red-1881\flows_ITC-NB-23.json
29 Jul 17:26:07 - [info] Server now running at http://127.0.0.1:1881/
29 Jul 17:26:07 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

29 Jul 17:26:07 - [info] +-----------------------------------------------------
29 Jul 17:26:07 - [info] | uibuilder v4.1.0 initialised
29 Jul 17:26:07 - [info] | root folder: c:\node-red-1881\uibuilder
29 Jul 17:26:07 - [info] | Using Node-RED's webserver at:
29 Jul 17:26:07 - [info] | http://192.168.68.101:1881/ or http://localhost:1881/
29 Jul 17:26:07 - [info] | Installed packages:
29 Jul 17:26:07 - [info] | jquery, socket.io, bootstrap-vue, vue
29 Jul 17:26:07 - [info] | bootstrap, vue.js
29 Jul 17:26:07 - [info] +-----------------------------------------------------
29 Jul 17:26:07 - [info] Starting flows
29 Jul 17:26:07 - [info] Dashboard version 2.30.0 started at /ui
29 Jul 17:26:07 - [info] Started flows
29 Jul 17:26:08 - [red] Uncaught Exception:
29 Jul 17:26:08 - TypeError: path must be absolute or specify root to res.sendFile
    at ServerResponse.sendFile (C:\Users\weeseong.hew\AppData\Roaming\npm\node_modules\node-red\node_modules\express\lib\response.js:425:11)
    at c:\node-red-1881\node_modules\node-red-contrib-ui-media\ui_media.js:288:17
    at FSReqCallback.oncomplete (fs.js:156:23)

```

---

<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: [29 July 2021 09:57 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/7 "2021-07-29T09:57:57Z")

</div>

That error might be related to node-red 2.0.2 (there are a few fixes in newest release 2.0.4)

I would upgrade node-red before trying too many things.

If the error persists then that might be an issue with the ui-media node (or node-red http handling)

---

<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: [29 July 2021 10:22 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/8 "2021-07-29T10:22:14Z")

</div>

That tells me that you didn't copy the flows file. It has created a new one for you.

You need to look in your master userDir folder (the original) and see what files and folders exist. Copy everything you need over except the node\_modules folder, you use `npm install` in each of the folders to download and install each contributed node into each folder. You can copy the folder if you like and avoid the install but it is thousands of files and will take a lot of time, especially if you try to use Windows Explorer.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 13:40 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/9 "2021-07-29T13:40:03Z")

</div>

I've uninstalled ui-media node and it still has the same issue

---

<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: [29 July 2021 13:42 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/10 "2021-07-29T13:42:41Z")

</div>

Are you sure it is uninstalled? Have you restarted node-red?  
If it is uninstalled, you will not get that error as the code will be deleted.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 13:42 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/11 "2021-07-29T13:42:42Z")

</div>

hmmm what I did was basically create a new folder 'node-red-1881' and copied all the files except the `node_modules` folder and paste it in the new folder. After that, I've launched Node-RED with the command `node-red -p 1881 -u c:/node-red-1881` and install all the palettes needed. After all that it still has the same issue. Even after I've uninstalled ui\_media palette.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [29 July 2021 13:43 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/12 "2021-07-29T13:43:17Z")

</div>

Yea, the things run normally after restarting node-red. I might give that a try again and see if it works.

Just went and check and it show this error log on the `127.0.0.1:1881/ui` now

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/6/762ff059a069f6b471d37aaff8a670a76fa5e4db.png)

---

<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: [29 July 2021 17:03 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/13 "2021-07-29T17:03:47Z")

</div>

Try editing the URL and remove everything _after_ the `/ui/`.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [30 July 2021 01:23 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/14 "2021-07-30T01:23:05Z")

</div>

I've updated node-red to 2.0.4 and it doesn't seem to solve that issue

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [30 July 2021 01:23 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/15 "2021-07-30T01:23:37Z")

</div>

Did that, it does nothing

---

<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: [30 July 2021 08:52 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/16 "2021-07-30T08:52:09Z")

</div>

Can you provide:

- A directory listing of `c:\node-red-1881`

- A screenshot of Editor Dashboard sidebar showing the layout tab

- The node-red log for that instance.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [30 July 2021 10:11 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/17 "2021-07-30T10:11:57Z")

</div>

- Directory  

- Editor Dashboard sidebar (i've actually changed the name to test around earlier)  

- Node-RED log

---

<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: [30 July 2021 20:58 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/18 "2021-07-30T20:58:44Z")

</div>

That last isn't the node-red log. You need the log that is shown when you start up node-red.

---

<div class="post-metadata">

### Author: ![WeeSeong](https://avatars.discourse-cdn.com/v4/letter/w/e19b73/32.png) [@WeeSeong](https://discourse.nodered.org/u/WeeSeong)
#### Post date: [31 July 2021 11:04 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/19 "2021-07-31T11:04:01Z")

</div>

Ahh my bad, here's the Node-RED log

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/4/24a5c4b845c92f3254dad459799e752a543156b5.png)

---

<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: [31 July 2021 13:09 UTC](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068/20 "2021-07-31T13:09:08Z")

</div>

So what exactly is the problem? The Uncaught Exception problem is not there, which I thought was the main issue.

[Next page](https://discourse.nodered.org/t/running-node-red-on-multiple-instances-but-with-separate-set-of-flow/49068.md?page=2)
