# HELP Can't write file to the designated documents with Ubuntu system

**URL:** <https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314>\
**Category:** General\
**Created:** [9 November 2022 09:54 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314 "2022-11-09T09:54:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kylar](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kylar](https://discourse.nodered.org/u/Kylar)\
**Post date:** [9 November 2022 09:54 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/1 "2022-11-09T09:54:53Z")

</div>

Hi guys. I am a newbie to using Node-red.

I am using sensors to record temperature and humidity and the data is currently displaying properly in Debug, but I am unable to use the write file function to record these continually updated data to a specified .txt file.

It writes fine on my other windows computer, but not on this Ubuntu server, and I suspect it is a problem with the Ubuntu system files. Has this happened to anyone else?

 ![11](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38c24cfe1a7713214690add1924f6fd6391a2901.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 November 2022 10:25 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/2 "2022-11-09T10:25:49Z")

</div>

as long as you are running it as user ace (so it has access to the /home/ace directory that looks ok. ( I would untick the creat directory option if you know the directory exists and you haven't added an extra path to the file name - but that won't make a difference to permissions).

---

<div class="post-metadata">

**Author:** ![Kylar](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kylar](https://discourse.nodered.org/u/Kylar)\
**Post date:** [9 November 2022 15:11 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/3 "2022-11-09T15:11:44Z")

</div>

Thanks for your rapid reply, Dceejay. I had unticked the create directory option but it didn't work. I'm now wondering if there's something wrong with my docker.

---

<div class="post-metadata">

**Author:** ![Kylar](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kylar](https://discourse.nodered.org/u/Kylar)\
**Post date:** [9 November 2022 15:16 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/4 "2022-11-09T15:16:21Z")

</div>

I used docker to install the Node-red. I now suspect that docker is not recognizing the files inside the host, so someone has used docker to run the Node-red and wrote file successfully?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [9 November 2022 21:09 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/5 "2022-11-09T21:09:57Z")

</div>

Ah right. That is critical information :-). So yes you need to mount the host directory into the docker container and give it the correct permissions. I think you need to read up on how to do a bind-mount

---

<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:** [9 November 2022 21:54 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/6 "2022-11-09T21:54:50Z")

</div>

Alternatively stop using Docker, unless you have a good reason for using it.

---

<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 January 2023 21:55 UTC](https://discourse.nodered.org/t/help-cant-write-file-to-the-designated-documents-with-ubuntu-system/70314/7 "2023-01-08T21:55:22Z")

</div>

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