I’m using n8n v2.34.6 (Self Hosted) in Docker on Ubuntu 24.04. I’m trying to save a file (downloaded from Telegram API) using the “Read/Write Files from Disk” node with operation “Write File to Disk”. However, I always get the error:
File Path and Name: /home/node/.n8n/references/test.ico
Input Binary Field: data
But I still get the error. I tried different paths: /data, /tmp/references, /home/node/.n8n. None worked. I added N8N_ALLOW_WRITE_TO_DISK=true and N8N_ALLOW_LIST_PATH. No luck.
What could be the reason? How can I allow the node to write to disk? Are there any additional settings or security restrictions in v2.34.6?
You need to change the N8N_ALLOW_LIST_PATH to the actual directory you intend for file storage. Since you’ve already mounted a volume to /data, that’s the perfect place.
Update the environment variable in your Docker run command like this:
After restarting your container with this change, you will be able to write files to any path inside the /data directory (e.g., /data/references/test.ico), and it will correctly save them to your host machine’s /root/n8n_storage folder.
Hi @Wvolcha Welcome! N8N_ALLOW_WRITE_TO_DISK and N8N_ALLOW_LIST_PATH are not n8n variables, so nothing set on them has any effect. The one the file nodes actually read is N8N_RESTRICT_FILE_ACCESS_TO, which defaults to ~/.n8n-files since 2.0:
-e N8N_RESTRICT_FILE_ACCESS_TO=/data
Separate multiple directories with ;, not a comma. /home/node/.n8n stays blocked whatever you allow-list, it’s n8n’s own state directory. The host folder needs to belong to the node user as well, so run chown -R 1000:1000 /root/n8n_storage before you recreate the container.
Hi @Anshul_Namdev, thank you so much! I changed my Docker command and used:
bash
-e N8N_RESTRICT_FILE_ACCESS_TO=/data
instead of the non-existent variables. I also ran chown -R 1000:1000 /root/n8n_storage and mounted the volume. The Read/Write Files from Disk node now works perfectly and saves files to /data.
Really appreciate the clear explanation — exactly what I neededThank you!