# Network drive on Nodered Docker

**URL:** <https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817>\
**Category:** General\
**Tags:** docker\
**Created:** [5 April 2022 07:45 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817 "2022-04-05T07:45:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay51](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Akshay51](https://discourse.nodered.org/u/Akshay51)\
**Post date:** [5 April 2022 07:45 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/1 "2022-04-05T07:45:44Z")

</div>

Hi guys,  
i couldn't use the network drive(Z) from local pc on the docker container(nodered). Tried by creating a volume for the drive from here

> **[docker volume create](https://docs.docker.com/engine/reference/commandline/volume_create/)**
>
> docker volume create: Creates a new volume that containers can consume and store data in. If a name is
> not specified, Docker generates a random name.

Can someboby plz help with 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:** [5 April 2022 08:08 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/2 "2022-04-05T08:08:33Z")

</div>

Just saying it does't work, doesn't help, also just pointing to the the documentation again doesn't show us what you actually tried and what the errors you saw.

Explain what you actually tried and how it failed and we might be able to help you fix it.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 April 2022 08:08 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/3 "2022-04-05T08:08:34Z")

</div>

Windows network drives are not real drives.

Lots of info on [Stackoverflow](https://www.google.com/search?q=docker+map+network+drive+site:stackoverflow.com) for this subject.

---

<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:** [5 April 2022 10:28 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/4 "2022-04-05T10:28:54Z")

</div>

Looks like this should work:

```auto
docker volume create --driver local --opt type=cifs --opt device=//networkdrive-ip/Folder --opt o=user=yourusername,domain=yourdomain,password=yourpassword mydockervolume

```

---

<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 April 2022 07:27 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/7 "2022-04-06T07:27:05Z")

</div>

If it's mounted as a volume it will be accessed by what ever path you mounted it on not `z:\`

We need to see them `docker run ` command you used to start the container with the volume to say what path you should use

---

<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 April 2022 13:38 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/9 "2022-04-06T13:38:23Z")

</div>

OK,

Assuming you have substituted the right bits into the first command that the volume points to the right network share, mounting it to `/data` in the container in the second command is going to mean that the network share is used to store the Node-RED flows and any nodes you install. It sounds like this is not what you are looking for. You don't want to use it to store the Node-RED state, but to access files on the share.

You should probably mount the volume to somewhere like `/mnt` then change the path in your flow from `z:\somedir\somefile` to `/mnt/somedir/somefile`

---

<div class="post-metadata">

**Author:** ![Akshay51](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Akshay51](https://discourse.nodered.org/u/Akshay51)\
**Post date:** [7 April 2022 12:35 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/10 "2022-04-07T12:35:06Z")

</div>

I do want to access those files. The log files are constantly updated every second and so copying the file to /mnt won’t be an option for me.

also I did create a volume for the drive but I couldn’t access those files. Saying “no such file or directory”.

---

<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:** [7 April 2022 13:19 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/11 "2022-04-07T13:19:48Z")

</div>

I'm not saying copy the files, I'm saying mount the volume on that mountpoint then use the right path to access the file.

You will always get the `node such file or directory` error if you try to use a path that starts with `z:\` because there are no drive letters in Linux and when you run Node-RED in docker it is running in **Linux** so you have to use Linux file paths.

---

<div class="post-metadata">

**Author:** ![Akshay51](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Akshay51](https://discourse.nodered.org/u/Akshay51)\
**Post date:** [8 April 2022 03:31 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/12 "2022-04-08T03:31:00Z")

</div>

Oh… okay.

So how would we do that?

I’m really sry if I’m asking too much. Getting stuck!

---

<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:** [8 April 2022 17:05 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/13 "2022-04-08T17:05:57Z")

</div>

it's difficult to find a way to help you with the info you provided. It sounds like you're confusing what a vm is, and what a container is... they are very different animals.

Sounds like you're running node-red as a container on a windows host, if that is the case, you should be able to create a volume (see the command on a post above). This volume should be mounted when you start node-red container (share the docker command you're using to start node-red container and we might be able to tell if you've something missing).

---

<div class="post-metadata">

**Author:** ![Akshay51](https://avatars.discourse-cdn.com/v4/letter/a/ac8455/32.png) [@Akshay51](https://discourse.nodered.org/u/Akshay51)\
**Post date:** [9 April 2022 03:27 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/14 "2022-04-09T03:27:23Z")

</div>

The docker is running on a Linux VM with nodered container in it. My main host machine is Windows and that’s why I’m all confused about.

I’m not familiar with Linux so much!

---

<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:** [8 June 2022 03:27 UTC](https://discourse.nodered.org/t/network-drive-on-nodered-docker/60817/15 "2022-06-08T03:27:45Z")

</div>

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