Nodered in docker container


I have node red running on my Ubuntu server in a docker container. I am trying to see if there are files present in a directory outside the container directory.

I have a fs-ops-dir node pointing to the following path: /home/foo/scripts

But when I deploy the flow, I get "Error: ENOENT: no such file or directory, scandir '/home/foo/scripts'"

/home/foo/scripts is the absolute path on my server.

I'm guessing it's because nodered is only looking at files within the container? Can someone confirm how to rectify this?

If you want to access files that are not bundled into the container you will need to look at Docker Volume mounts which will allow you to map local directories and files into the container.

The other alternative is, of course, not to use Docker. That is unless you have a good reason for using Docker. To perform a normal install on node red use the Debian/Ubuntu/Pi script at Running on Raspberry Pi : Node-RED

thanks for the responses. I am struggling with the instructions on that website (sorry!).

Is this what I am looking for:

docker run -d \
  --name this_volume \
  --mount source=/home/foo/scripts,target=/scripts \

which will then mount /home/foo/scripts into /scripts folder in the nodered container? assuming mynodered is the container name?

Good idea - I've installed it without using docker. Do you know where the default directory is so I can back up my config etc. incase my computer crashes? I will create a script to upload the folder to my cloud once a week.

Assuming you mean the folder where the settings and flows files are then if you stop node red and start it again using
then it will tell you. It should be .node-red under your home folder.
You don't need to back up .node-red/node_modules, which is where nodes are installed. That can be be very many files and quite large.

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