How can I make a Docker-based n8n access files on my computer?

0
1
Asked By MellowKite47 On

I'm running n8n locally inside Docker and using a Read from Disk node to load files such as an .xlsx spreadsheet or a PDF. The node keeps returning "No file found" even when I enter the exact path. I also tried paths like /home/nodes/files/file.pdf, but then received a permissions or access error. How should I configure Docker so n8n can see files stored on my computer, and what path should I use in the node?

2 Answers

Answered By SilverOrchid19 On

If you start n8n with `docker run`, the equivalent is a volume option such as `-v C:/Users/you/n8n-files:/files` on Windows, or `-v /path/on/your/computer/n8n-files:/files` on Linux or macOS. The first path is on your host machine; the second path is where the folder appears inside the container. Make sure the file is actually inside the host folder and restart n8n after changing the mount.

HarborFox63 -

Also check that Docker has permission to access the host folder, especially on Windows or macOS where shared-folder permissions may need to be enabled.

Answered By CopperVale82 On

This usually happens because the file is on your host computer, while n8n is running inside a container with its own isolated filesystem. You need to bind-mount a folder from your computer into the container. For example, with Docker Compose, add a volume under the n8n service: `volumes: - ./local-files:/files`. Put the spreadsheet or PDF in the local-files folder, restart the container, and use the container-side path in n8n, such as `/files/yourfile.xlsx`—not the original path from your computer.

MellowKite47 -

Got it, I’ll try mapping a local folder and then use the `/files/...` path from inside the container.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.