We’re exploring the self-hosted option in AWS EKS. We want mult-main/queue mode. Apparently, we will purchase an enterprise license. We will use elasticache, Aurora PostgreSQL and S3 for binary data storage. We will set N8N_ENCRYPTION_KEY with our own value.
While not essential for running n8n, using persistent volumes helps maintain files uploaded while using n8n and if you want to persist manual n8n encryption keys between restarts, which saves a file containing the key into file storage during startup.
I’m not sure if I can skip this persistent volume, what kind of data that N8N stored in /home/node/.n8n? We will run multiple instances of main, webhook and worker, using gp3 volume with ReadWriteOnce access mode doesn’t make sense to me.
Basically the .n8n folder holds all the data, for example on a fresh install self-hosted version there are the workflows, the DB sqlite with all the credentials and the Memory.
thank you @Parintele_Damaskin we will deploy multiple main pods, multiple webhook pods and multiple worker pods. If using AWS gp3 persistent volume, we need to use access mode ReadWriteOnce. That means each pod uses a different persistent volume claim. And effectively, all pods share nothing in the file system at /home/node/.n8n
We will use an external Postgres DB instead of SQLite; use S3 instead of filesystem in N8N_AVAILABLE_BINARY_DATA_MODES=s3; pre-set N8N_ENCRYPTION_KEY instead of relying on auto generated value. Giving this setup, is a persistent volume for /home/node/.n8n still required on each Kubernetes pod?
Even with Postgres, the .n8n directory still stores “other important data like encryption keys, instance logs, and source control feature assets,” and the recommendation is to continue mapping a persistent volume for it “to avoid potential issues.”
I am not a kubernet fan, and more than this actually I cannot help…
Maybe @mohamed3nan have more clues on this and help with an viewpoint….
About instance logs, in container, logs will be written to console. I don’t think it writes to /home/node/.n8n
About encryption keys, we set N8N_ENCRYPTION_KEY environment variable to all container, I guess /home/node/.n8n is not needed for this.
I have no idea about source control.
Kubernetes doesn’t matter here. Let’s say, if we just run n8n with docker. When we run queue mode with multi-main, each container on a dedicated machine/VM. Apparently, we need to mount a volume for /home/node/.n8n. Unless we have to use a shared read-write volume like NFS, each N8N docker container will have its own /home/node/.n8n volume.
I will mount volume for /home/node/.n8n. My question is: do all N8N containers require to see the same /home/node/.n8n? Because it’s unclear to me about what data is stored in that folder, I couldn’t answer that question myself.
home/node/.n8n is the user folder used by n8n to store several kinds of data:
SQLite DB file (if you use SQLite)
Encryption key (if you don’t provide N8N_ENCRYPTION_KEY)
Logs
Assets for certain features like source control
If you set N8N_ENCRYPTION_KEY on all containers, n8n can use that instead of a key stored in .n8n. In queue mode, you must set the encryption key env var for all workers.
Even when you don’t rely on the key file (because of N8N_ENCRYPTION_KEY), docs still recommend mapping a persistent volume for .n8n due to “other important data like encryption keys, instance logs, and source control feature assets.”
Summarry from what I understood myself as well… still “recomnmended mapping a persistent volume for the directory” and highlihght that it cobntains “other important data,” so running each instance with its own isolasted .n8n would be going beyond what is recommendded.