Docker config with write binary files

Hey guys,

Another question, I am currently running a docker image with the yml config for:

Docs say to add this to volumes:
- /local-files:/files

I have added that, but the write binary isn’t seeing it or something.

When I change the $DATA_FOLDER to

  • ${DATA_FOLDER}/.n8n/local-files:/files
    Write binary works fine but I lose all my workflows and credentials, because they are obviously stored there.

Do I need to migrate all of that to the new $DATA_FOLDER structure or is there a way to add local-files folder to my config properly?

Thanks so much!

/local-files:/files is just an example. One that you would probably not use directly like that. This example would make the folder /local-files of your host machine available as /files in your n8n docker container. So if you write the file /files/my-text-file.txt in n8n, would it appear on your host as /local-files/my-text-file.txt.

What you would probably mound would be something like ~/n8n-files:/shared. Then you can write files to the folder /shared and they would then show up on your machine in the folder n8n-files in your user folder (so ~/n8n-files or /home/[YOUR USERNAME]/n8n-files.

Btw. if you set your DATA_FOLDER to /home/[YOUR USERNAME]/ then the following would be identical to the above:

  - ${DATA_FOLDER}/n8n-files:/shared

Hope that is helpful!

1 Like

Thanks @jan, this made perfect sense. Sorry docker stuff is new to me!

Glad to hear that it helped.

Absolutely nothing to be sorry for! It was also new for me at some point, and back then I was always happy if somebody explained the concepts to me.

Have fun!