How can I mount a local folder into my Docker container?

Hello everyone,

I am using n8n through Docker Desktop on Windows 11.

How can I mount a local folder into my Docker container?

I would like to retrieve a local file using the “Read/Write Files from Disk” node.

Thank you!

Assuming you are starting the n8n container with a docker-compose.yml, just add another entry in the volumes section, and reference the 2nd part (the container path) from the Read/Write Files node.

    volumes:
      - ./n8n_app_storage_volume:/home/node/.n8n
      - ./n8n_scratch_storage_volume:/tmp/workflow_files

If you need to reference a directory/folder other than the one where docker-compose.yml is stored, on windows you just need to ignore the normal \ file separator and use / instead, like.

    volumes:
      - ./n8n_app_storage_volume:/home/node/.n8n
      - "C:/Users/Bob/Desktop/n8nstuff:/tmp/workflow_files"

Then to read a file named myphoto.jpg, the Read/Write Files node would look like this:

Hey, thanks for the advice.

But how can i add These to my docker Container? I start the Container in the Docker Desktop GUI.

Thanks!

Hi,

You can use the following syntax :

I don’t think there is a way to do this directly from the desktop-gui

regards,
J.