# Nodered in docker container

**URL:** https://discourse.nodered.org/t/nodered-in-docker-container/51043
**Category:** General
**Created:** [15 September 2021 07:37 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043 "2021-09-15T07:37:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)
#### Post date: [15 September 2021 07:37 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/1 "2021-09-15T07:37:06Z")

</div>

Hello

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?

---

<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: [15 September 2021 08:00 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/2 "2021-09-15T08:00:50Z")

</div>

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.

> **[Use volumes](https://docs.docker.com/storage/volumes/)**
>
> Using volumes

---

<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: [15 September 2021 08:16 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/3 "2021-09-15T08:16:04Z")

</div>

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](https://nodered.org/docs/getting-started/raspberrypi)

---

<div class="post-metadata">

### Author: ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)
#### Post date: [15 September 2021 08:21 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/4 "2021-09-15T08:21:59Z")

</div>

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

Is this what I am looking for:

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

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

---

<div class="post-metadata">

### Author: ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)
#### Post date: [15 September 2021 09:50 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/5 "2021-09-15T09:50:39Z")

</div>

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.

---

<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: [15 September 2021 09:54 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/6 "2021-09-15T09:54:40Z")

</div>

> [@Sirhc](#):
>
> Do you know where the default directory is

Assuming you mean the folder where the settings and flows files are then if you stop node red and start it again using  
`node-red-stop`  
`node-red-start`  
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.

---

<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: [14 November 2021 09:54 UTC](https://discourse.nodered.org/t/nodered-in-docker-container/51043/7 "2021-11-14T09:54:42Z")

</div>

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