# Read/Write Files from Disk The file "x" is not writable

**URL:** <https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765>\
**Category:** Questions\
**Tags:** node\
**Created:** [February 20, 2026, 2:57pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765 "2026-02-20T14:57:12Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Poxitite](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/poxitite/32/59648_2.png) [@Poxitite](https://community.n8n.io/u/Poxitite)\
**Post date:** [February 20, 2026, 2:57pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/1 "2026-02-20T14:57:13Z")

</div>

```auto
Good morning, I'm a beginner with n8n, and I'm having trouble reading/writing files from disk.
I have a workflow that works fine up to the HTTP request, but when I try to write PDF files to disk, I get an error saying I can't write to disk.
I'm using:
Docker
Windows 11 - WSL
I've attached my docker-compose.yml file; it might be a bit messy. I've tried every solution I found online.
The folder where I want to save the files is c:\n8n_files\OT\01_Entrada. In n8n, it shows up with the "Mount" message.
If you can help me, I'd be very grateful.

```

docker-compose.yml  
services:  
n8n:  
image: n8nio/n8n:latest  
platform: linux/amd64  
environment:  
N8N\_EDITOR\_BASE\_URL: [http://0.tcp.sa.ngrok.io:11167](http://0.tcp.sa.ngrok.io:11167)  
WEBHOOK\_URL: [http://0.tcp.sa.ngrok.io:11167](http://0.tcp.sa.ngrok.io:11167)  
N8N\_HOST: [0.tcp.sa.ngrok.io](http://0.tcp.sa.ngrok.io)  
N8N\_PORT: 5678  
N8N\_BINARY\_DATA\_MODE: filesystem  
N8N\_RESTRICT\_FILE\_ACCESS\_TO: /n8n\_files/  
N8N\_BINARY\_DATA\_STORAGE\_PATH: /home/node/files/.binary  
N8N\_PROTOCOL: http  
GENERIC\_TIMEZONE: America/Sao\_Paulo  
N8N\_LOG\_LEVEL: debug  
N8N\_SECURE\_COOKIE: false  
N8N\_USER\_MANAGEMENT\_DISABLED: true  
N8N\_BASIC\_AUTH\_ACTIVE: false  
N8N\_COMMUNITY\_PACKAGES\_ALLOW\_TOOL\_USAGE: true  
N8N\_BLOCK\_FS\_WRITE\_ACCESS\_TO\_WHITELIST: false  
N8N\_ENFORCE\_SETTINGS\_FILE\_PERMISSIONS: false  
N8N\_BLOCK\_FS\_WRITE\_ACCESS: false  
NODES\_EXCLUDE:   
N8N\_RUNNERS\_ENABLED: true  
volumes:  
- n8n\_data:/home/node/.n8n  
- C:/n8n\_files:/home/node/files:rw  
ports:  
- “5678:5678”  
PrintScreen:

 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/6/5/658e483b8d6638f676ea6d045914905e30ab2230.png)  
 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/0/6/0638e23b2c63dead685f4f3a44651a3e8c42d43d.png)

---

<div class="post-metadata">

**Author:** ![A\_A4](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/a_a4/32/58794_2.png) [@A\_A4](https://community.n8n.io/u/A_A4)\
**Post date:** [February 20, 2026, 3:28pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/2 "2026-02-20T15:28:35Z")

</div>

Hi @Poxitite

update the environment variable to match your container’s internal path: `N8N_RESTRICT_FILE_ACCESS_TO=/home/node/files/`

because your `docker-compose.yml` tells n8n it is strictly only allowed to access `/n8n_files/`. however, you mounted your volume to `/home/node/files`

```auto
services:
  n8n:
    image: n8nio/n8n:latest
    platform: linux/amd64
    environment:
      # ... your other env vars ...
      N8N_RESTRICT_FILE_ACCESS_TO: /home/node/files
      N8N_BINARY_DATA_MODE: filesystem
      N8N_BINARY_DATA_STORAGE_PATH: /home/node/files/.binary
    volumes:
      - n8n_data:/home/node/.n8n
      - C:/n8n_files:/home/node/files:rw

```

---

<div class="post-metadata">

**Author:** ![Poxitite](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/poxitite/32/59648_2.png) [@Poxitite](https://community.n8n.io/u/Poxitite)\
**Post date:** [February 20, 2026, 4:19pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/3 "2026-02-20T16:19:51Z")

</div>

> [@A\_A4](#):
>
> /home/node/files/

Thank you very much for your response.

But it still doesn’t work; I’ve tried. It returns the same error.  
After changing the `docker-compose.yml` file and using `docker compose down` and `docker compose up -d`, I still can’t write to the file.

---

<div class="post-metadata">

**Author:** ![A\_A4](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/a_a4/32/58794_2.png) [@A\_A4](https://community.n8n.io/u/A_A4)\
**Post date:** [February 20, 2026, 8:48pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/4 "2026-02-20T20:48:19Z")

</div>

windows is likely locking the folder permissions when docker mounts it.

add a new line `user: "root"` right below your `image: n8nio/n8n:latest` line in the compose file to bypass the permission lock.

don’t forget to run `docker compose down` and `docker compose up -d` to apply the changes.

let me know if it still blocks you.

---

<div class="post-metadata">

**Author:** ![Mayank1024](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/mayank1024/32/158400_2.png) [@Mayank1024](https://community.n8n.io/u/Mayank1024)\
**Post date:** [February 20, 2026, 11:25pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/5 "2026-02-20T23:25:50Z")

</div>

Hey @Poxitite,  
Welcome to the community!

this error is usually either n8n blocking the path or the container user not having write permission to the Windows-mounted folder. In your docker-compose.yml you currently have N8N\_RESTRICT\_FILE\_ACCESS\_TO: /n8n\_files/ but your actual mount is C:/n8n\_files:/home/node/files:rw, so n8n can end up refusing writes because the allowed path doesn’t match where you’re writing.

Set N8N\_RESTRICT\_FILE\_ACCESS\_TO=/home/node/files (and remove the /n8n\_files one), then fully restart with docker compose down and docker compose up -d. After that, verify the container can actually write by executiing in and running a quick write test like touch /home/node/files/OT/01\_Entrada/test.txt (also check perms with ls -ld on those folders).

if the touch fails, it’s a Windows/WSL mount permissions issue (the container runs as the node user and sometimes the mount behaves effectively read-only), in which case a quick fix is to temporarily run the container as root (user: “0:0”), chown -R node:node /home/node/files, then switch back and restart.

One small extra thing: your filenames include spaces (e.g., 5058-horas Categorias.pdf) which usually works but can still cause edge-case issues, so if everything else is fixed and it still fails, try replacing spaces with underscores in the filename expression.

If you paste the output of that touch test (and the ls -ld lines), I can tell you exactly whether it’s the n8n restriction or mount permissions causing it.

---

<div class="post-metadata">

**Author:** ![achamm](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/achamm/32/143734_2.png) [@achamm](https://community.n8n.io/u/achamm)\
**Post date:** [February 21, 2026, 12:47am UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/6 "2026-02-21T00:47:28Z")

</div>

The path fix is right but WSL + Docker volume mounts to Windows paths are notoriously finicky with permissions. Try adding `user: "root"` to your compose file like suggested, and if that still doesn’t work try creating the folder structure inside WSL itself (like `/mnt/c/n8n_files/OT/01_Entrada`) and make sure the folder exists and is writable with `chmod 777` on it before mounting. Windows folder permissions don’t always translate cleanly through the WSL layer.

---

<div class="post-metadata">

**Author:** ![achamm](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/achamm/32/143734_2.png) [@achamm](https://community.n8n.io/u/achamm)\
**Post date:** [February 21, 2026, 1:56am UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/7 "2026-02-21T01:56:14Z")

</div>

Looking at the screenshots, the folder structure exists inside the container at `/home/node/files/OT/01_Entrada/` which is good, but the write still fails even with the path fix. Since you’ve already tried the `N8N_RESTRICT_FILE_ACCESS_TO` change and it’s still blocking, try running `docker exec -it n8nwahalocal-n8n-1 sh -c "touch /home/node/files/OT/01_Entrada/test.txt"` from your terminal to see if the container can actually write there at all — if that fails too then it’s definitely a Windows/WSL mount permission issue and you’ll need the `user: "root"` line or to fix the folder permissions on the Windows side.

---

<div class="post-metadata">

**Author:** ![Poxitite](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/poxitite/32/59648_2.png) [@Poxitite](https://community.n8n.io/u/Poxitite)\
**Post date:** [February 23, 2026, 12:49pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/8 "2026-02-23T12:49:55Z")

</div>

> [@achamm](#):
>
> `docker exec -it n8nwahalocal-n8n-1 sh -c "touch /home/node/files/OT/01_Entrada/test.txt"`

Good morning. Thank you for your responses. I couldn’t reply over the weekend because I was busy with construction work at my house. Here’s a screenshot of the test you mentioned. The test worked to generate the “test.txt” file. I had already run the test, and the “test.txt” file was from a previous test.  
Regarding folder access, User, System, and admin have full control access. I’m still trying things out.  
PrintScreen:

 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/3/b/3be384945877681e622ab8c2b7bbb77b8dffd1a3.png)  
 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/5/4/548388957547a6944415debaf12817ee02866a8b.png)  
 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/2/c/2c6defcc48fbf7591fee579702851582b6874c9a.png)

---

<div class="post-metadata">

**Author:** ![achamm](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/achamm/32/143734_2.png) [@achamm](https://community.n8n.io/u/achamm)\
**Post date:** [February 23, 2026, 2:10pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/9 "2026-02-23T14:10:50Z")

</div>

Interesting, so the `touch` command worked from inside the container which means the mount permissions are actually fine. The issue is probably that n8n runs as the `node` user by default but your exec command ran as root. Try adding `user: "root"` to your docker-compose like was suggested earlier, or alternatively run `docker exec -it n8nwahalocal-n8n-1 sh -c "chown -R node:node /home/node/files"` to give the node user ownership of that directory.

---

<div class="post-metadata">

**Author:** ![Poxitite](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/poxitite/32/59648_2.png) [@Poxitite](https://community.n8n.io/u/Poxitite)\
**Post date:** [February 23, 2026, 2:56pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/10 "2026-02-23T14:56:07Z")

</div>

Good morning. Thank you for your responses. I performed the test, and the result is:

 ![imagen](https://europe1.discourse-cdn.com/n8n/original/3X/8/4/849853502d65ab8888fd26b7a700b27e29f81f40.png)

---

<div class="post-metadata">

**Author:** ![achamm](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/achamm/32/143734_2.png) [@achamm](https://community.n8n.io/u/achamm)\
**Post date:** [February 24, 2026, 9:36pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/11 "2026-02-24T21:36:50Z")

</div>

@Poxitite try using sudo

---

<div class="post-metadata">

**Author:** ![markup](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/markup/32/61480_2.png) [@markup](https://community.n8n.io/u/markup)\
**Post date:** [February 25, 2026, 5:50am UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/12 "2026-02-25T05:50:05Z")

</div>

Does it work if you mount another volume and restrict file access to that one?

1. Create a folder “n8n\_files” beside your docker-compose.yml
2. mount this volume:  
`- ”./n8n_files:/files”`
3. Restrict file access to the new volume:  
`N8N_RESTRICT_FILE_ACCESS_TO: “/files“`

---

<div class="post-metadata">

**Author:** ![Haian\_Abou-Karam](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/haian_abou-karam/32/159163_2.png) [@Haian\_Abou-Karam](https://community.n8n.io/u/Haian_Abou-Karam)\
**Post date:** [March 2, 2026, 1:38pm UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/13 "2026-03-02T13:38:48Z")

</div>

Hi, @Poxitite  
Please take a look at my new related tutorial:

* * *

> [@N8n Docker File-System Debug Checklist (2-Minute Method)](http://community.n8n.io/t/n8n-docker-file-system-debug-checklist-2-minute-method/272013):
>
> A complete troubleshooting guide for fixing file write & binary data issues on Windows + Docker + WSL Introduction If you run n8n locally using Docker on Windows, sooner or later you may face one of these problems: broken_chain Workflows fail when saving files broken_chain Binary data nodes throw permission denied broken_chain Files appear inside the container but not on Windows broken_chain /home/node/files looks empty …

* * *

---

<div class="post-metadata">

**Author:** ![Sushi\_Vorger](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sushi_vorger/32/60599_2.png) [@Sushi\_Vorger](https://community.n8n.io/u/Sushi_Vorger)\
**Post date:** [May 1, 2026, 1:55am UTC](https://community.n8n.io/t/read-write-files-from-disk-the-file-x-is-not-writable/267765/14 "2026-05-01T01:55:40Z")

</div>

I had the same problem, this was the trick for me, set:

in enviorement change the file acces to:

N8N\_RESTRICT\_FILE\_ACCESS\_TO=/files

In volumes change

- C:/n8n\_files:/home/node/files:rw

for

- C:/n8n\_files:/files
