# failed to create file: Error: EACCES: permission denied, mkdir

**URL:** <https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479>\
**Category:** General\
**Created:** [20 April 2021 22:02 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479 "2021-04-20T22:02:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vb70.exe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vb70.exe/32/40528_2.png) [@vb70.exe](https://discourse.nodered.org/u/vb70.exe)\
**Post date:** [20 April 2021 22:02 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/1 "2021-04-20T22:02:22Z")

</div>

Hello I have a problem of permission with nodered docker in my flow.json I have a file node that should create a txt file for me to save info but I have this message: failed to create file: Error: EACCES: permission denied, mkdir Can someone help me?

---

<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:** [21 April 2021 07:55 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/2 "2021-04-21T07:55:26Z")

</div>

Welcome to the forum @vb70.exe

Are you using Docker for a reason? It can make life more difficult.

What path are you trying to save it too? You can't directly access the host file system from Docker apps, you have to set up a Docker volume to map the Docker system to the host.

---

<div class="post-metadata">

**Author:** ![vb70.exe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vb70.exe/32/40528_2.png) [@vb70.exe](https://discourse.nodered.org/u/vb70.exe)\
**Post date:** [21 April 2021 09:13 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/3 "2021-04-21T09:13:10Z")

</div>

Thanks you @Colin,  
Yes it is important to use a nodered container for this project. And yes i created a volume that I mapped to the container -v datanodecollect:/data but the file node must create the file in a directory /home/imako/tests.  
How do I point the file node to the dedicated volume of the nodered container?

---

<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:** [21 April 2021 09:22 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/4 "2021-04-21T09:22:44Z")

</div>

Point it to the container internal folder that you have mapped to the tests folder.

---

<div class="post-metadata">

**Author:** ![vb70.exe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/vb70.exe/32/40528_2.png) [@vb70.exe](https://discourse.nodered.org/u/vb70.exe)\
**Post date:** [21 April 2021 19:54 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/5 "2021-04-21T19:54:46Z")

</div>

My question is How can I get the file node (node:file) to store itself in the volume?

---

<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:** [21 April 2021 20:28 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/6 "2021-04-21T20:28:57Z")

</div>

If, for example you map the docker volume /Tests to the host file system folder /home/imako/tests then in the file node to write to the file /home/imako/tests/somefile you use /Tests/somefile.

---

<div class="post-metadata">

**Author:** ![utmostGrandPoobah](https://avatars.discourse-cdn.com/v4/letter/u/43a26b/32.png) [@utmostGrandPoobah](https://discourse.nodered.org/u/utmostGrandPoobah)\
**Post date:** [27 May 2021 07:28 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/7 "2021-05-27T07:28:08Z")

</div>

Further reading on creating a Docker volume for people like me who encountered this error and had no idea what a Docker volume is or larger implications (or even just how to setup) - [link](https://docs.docker.com/storage/volumes/)

---

<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:** [26 July 2021 07:28 UTC](https://discourse.nodered.org/t/failed-to-create-file-error-eacces-permission-denied-mkdir/44479/8 "2021-07-26T07:28:40Z")

</div>

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