# Running Custom settings.js in node-red container

**URL:** <https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080>\
**Category:** General\
**Tags:** docker\
**Created:** [22 September 2022 14:04 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080 "2022-09-22T14:04:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elvisj007](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@elvisj007](https://discourse.nodered.org/u/elvisj007)\
**Post date:** [22 September 2022 14:04 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080/1 "2022-09-22T14:04:15Z")

</div>

I am trying to run a custom settings.js on my N-R docker contrainer. I tried couple of methods, but non of it is working.

1. tried to copy and replace the exisiting "settings.js" to the /data directory in the container

2. created a volume and saved the new "settings.js" in the volume and tried to run the container using  
"sudo docker run -it -p 1880:1880 -v avolume:/data mynode-red"

3. tried to use "--settings" to specify my new settings file in the run command  
"sudo docker run -it -p 1880:1880 -v avolume:/data --settings settings.js mynode-red" (the settings  
.js is copied to the work directory in the container )

---

<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:** [22 September 2022 16:43 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080/2 "2022-09-22T16:43:29Z")

</div>

What is wrong with letting node-red create the settings file in your /data volume then just changing it? As I understand it the standard node-red docker build uses the data volume as the userDir folder so other than it is on a different volume, there should be no difference to normal running?

---

<div class="post-metadata">

**Author:** ![elvisj007](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@elvisj007](https://discourse.nodered.org/u/elvisj007)\
**Post date:** [23 September 2022 08:52 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080/3 "2022-09-23T08:52:16Z")

</div>

I tried that, once the node-red creates the setting file in the volume and i tried making changes to that setting file. but when i run the container it keeps updating the setting files to the default one. everytime i run the container i have to manually copy my settings file to the /data dir to replace the default setting file and restart the container.

---

<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:** [23 September 2022 12:07 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080/4 "2022-09-23T12:07:26Z")

</div>

I don't think it should be doing that. @dceejay or @Steve-Mcl - any ideas?

---

<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:** [22 November 2022 12:07 UTC](https://discourse.nodered.org/t/running-custom-settings-js-in-node-red-container/68080/5 "2022-11-22T12:07:59Z")

</div>

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