# Multiple docker instances - best way to specify specific settings.js

**URL:** <https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182>\
**Category:** General\
**Tags:** docker\
**Created:** [5 January 2022 22:53 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182 "2022-01-05T22:53:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [5 January 2022 22:53 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/1 "2022-01-05T22:53:04Z")

</div>

I run a few instances of Node-red using docker containers. I'd like to have differently named settings files for each instance. Anyone suggest the best way of doing this?

(I'm using docker under Unraid if it's relevant)

---

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [6 January 2022 10:20 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/2 "2022-01-06T10:20:52Z")

</div>

Hah ok I've solved it. I set the $FLOWS env varianble to --settings=/data/xxxsettings.js  
Is this a reasonable solution? or am I perverting things? I guess this is a node-red docker 'thing'

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [6 January 2022 13:37 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/3 "2022-01-06T13:37:44Z")

</div>

It would probably be better/cleaner to have separate volumes mounted on `/data` for each instance then they can't clash with each other.

---

<div class="post-metadata">

**Author:** ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)\
**Post date:** [6 January 2022 15:15 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/4 "2022-01-06T15:15:19Z")

</div>

+1 this option is cleaner

---

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [6 January 2022 17:58 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/5 "2022-01-06T17:58:05Z")

</div>

er I do have separate volumes, there are no clashes. This was about making it a bit easier to manage editing the config files. Was a small ergonomic point

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [6 January 2022 18:11 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/6 "2022-01-06T18:11:47Z")

</div>

If there volumes are suitably named, then why bother naming the settings.js file as well ..

---

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [6 January 2022 18:38 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/7 "2022-01-06T18:38:28Z")

</div>

Just in case it is in a small way interesting I will fully describe my use case. I have the following node-red environments -:

1. /nodered - Production
2. /nodered2 - Testing of docker vs standalone facets (probably should be deleted)
3. /nodered3 - Beta Testing
4. /nodered4 - Development
5. /nodered5 - Completely clean environment (probably should be deleted)

So indeed my volumes are poorly named.  
I am a bit of a chaotic undisciplined developer and I like to have backups and reverts easily available I am also ancient and although I am becoming more git literate, I still don't really trust myself to rely on it.

So I regularly download flows to files called DevFlows, BetaFlows etc. I like to have a directory with all the downloaded flows and the corresponding settings files (nicely named) to facilitate a recovery/revert

Hope my topic wasn't 'clickbait' to you and I hope I haven't wasted your time. Thanks for thinking about it

---

<div class="post-metadata">

**Author:** ![lu4t](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lu4t/32/32276_2.png) [@lu4t](https://discourse.nodered.org/u/lu4t)\
**Post date:** [6 January 2022 19:24 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/8 "2022-01-06T19:24:29Z")

</div>

With this volumes structure mapped to your different environments, I still do not see why you need to "download" the files of each. As long as each container has its own /data folder, you don't need to rename settings.js file to have a specific setting on each NR env.

To back-up / revert to previous versions, if you're not into gitOps, you could cron a back-up of the meaningful files/folders into a different host, and you should be good.

---

<div class="post-metadata">

**Author:** ![davec1001](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@davec1001](https://discourse.nodered.org/u/davec1001)\
**Post date:** [6 January 2022 20:14 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/9 "2022-01-06T20:14:08Z")

</div>

Many thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 January 2022 20:14 UTC](https://discourse.nodered.org/t/multiple-docker-instances-best-way-to-specify-specific-settings-js/56182/10 "2022-01-20T20:14:50Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
