Locate and edit settings.js file under Docker

Several different lines of inquiry have lead to requiring editing the settings.js file. I am not able to locate it. I am running Node-Red under Docker on Raspberry Pi. Search of internet indicates several others are stuck on this as well, and no definitive answer.

Thanks.

Tim

How did you setup your docker instance??

The settings.js file is located where you specified how/where you save your static data.

It is clearly defined here ---> https://nodered.org/docs/getting-started/docker

" Node-RED uses the /data directory inside the container to store user configuration data."


I use a Bind Mount. So I start my docker container tied to a directory on my servers hdd for ease of use and backup.

$ sudo docker run -d --restart always --log-opt max-size=5m --log-opt max-file=10 \
--name=node-red \
-p 1880:1880 \
-e DUID=1000 \
-e DGID=1000 \
-v /home/YourUserDirHere/docker/node-red:/data \
nodered/node-red

The important line is: -v /home/YourUserDirHere/docker/node-red:/data \

Now in my /home/YourUserDirHere/docker/node-red directory on my hard drive I can edit the settings.js file.

Don't forget to stop the docker instance before editing and then start your docker instance of node-red after the edit.

You can also edit settings.js while Node-RED is running as it's only read on startup. Restart after editing is enough. Of course in this case the bind mount needs to be configured and the docker instance restarted before doing the modifications.

Are you also using Portainer (highly recommended!)? If so, you can just go to the "Exec Console" under "Quick actions" next to your container. Then you get a terminal window within the container, and from there it will be at "/data/settings.js".

Portainer can also show you the volume mappings in case you no longer remember how it was set up (can be done with Docker commands too, but Portainer simplifies it greatly).

1 Like

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