Where are files written when self-hosting in Docker?

Describe the problem/error/question

I would like to write files locally while self-hosting using the method described here: Docker | n8n Docs

Specifically I am trying to use the Read/Write File node, but I actually do not care how it is accomplished. The goal is to generate audio, video, text, etc. with other nodes and then save it on the local file system.

I managed to save a basic text file and see it in the n8n UI but when searching my computer for the filename, I couldn’t find it anywhere (I am on MacOS 14.5 (23F79))

I am open to switching the setup to a local hosted version only using docker for the DB (or not at all) as I really don’t like the idea of not being able to see the files anyway and have never worked on software that was entirely hosted inside Docker before.

Please share your workflow

Share the output returned by the last node

Text

Information on your n8n setup

  • n8n version:
    1.73.1
  • Database (default: SQLite):
    SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
    Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
    Docker local hosted
  • Operating system:
    MacOS 14.5 (23F79)

The files are written /home/node directory in docker. What I do is create a directory inside /home/node and then have a volume mapped in docker so I can easy access it on the server.

1 Like

Thank you for your response!

Screenshot 2025-01-11 at 5.02.34 PM
Screenshot 2025-01-11 at 5.02.45 PM

I have looked into the /home folder, and all over my mac and have actually not been able to find any folder called node. I am realizing my node was most likely installed under nvm on a different user.

I read about mounting local directories to a docker container using the -mount or -v docker parameters but I still unfortunately am a path noob on MacOS so I’m not sure how to just take a folder on my desktop that I use for all my scripts, and make it binded to the docker container so that n8n can write files there haha.

I’m really baffled by this whole thing because even in docker I don’t see the text file I created with the n8n Write File node.
Screenshot 2025-01-11 at 5.06.26 PM

EDIT: Ok I actually managed to find the file in docker itself, but not sure how to access it on my mac or realistically navigate these file paths in n8n for read and write. I guess I could just trust everything is in there, but I prefer to look at it in Finder if the folder is binded somehow

Also isn’t this storage cleared out every time I restart the container? It would be so much better for development and archival purposes if everything persisted and I could look at it in the mac filesystem

Not sure how you are creating your docker instances but I use docker compose so what I do is create a directory inside the /home/node directory where I want to store anything accessible outside easily and then map a location on your physical machine to that, so in docker compose it would be
volumes:
- n8n_storage:/home/node/.n8n
- :/home/node/

Hope that helps.

2 Likes

creating a folder in my user directory (~/ on mac) and creating a n8n folder, then adding -v ~/n8n:/home/node/ to the launch command allowed me to move files to and from this container while it is live.

As I hoped, this also enabled persistence. All other files were deleted using the standard launch command provided by n8n docs because it only maps an internal docker volume to a docker container, and does not actually store it on your filesystem so when you reboot you lose everything except the db changes, configs, etc.

So this is great and makes my local machine version of n8n worth the effort I have been putting into it.

Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.