2 months ago
I am trying to mount a volume to my n8n. (I am in hobby plan). Deployment crashes and I get this error :
Error: EACCES: permission denied, mkdir '/home/node/data/.n8n'
at new InstanceSettings (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core_@opentelemetry+api@1.9.0_@opentelemetry+exporter-trace-otlp_9f358c3eeaef0d2736f54ac9757ada43/node_modules/n8n-core/src/instance-settings/instance-settings.ts:73:24)
mount path: /home/node/data
size: 5gb.
Or should I mount postgre instead of volume mount? I want it not to loose my workflow and data when I redeploy the n8n instance.
Pinned Solution
2 months ago
Hello fuad47,
your issue is that the n8n image runs as a non-root user but railway mounts volumes as root so the node user can't write to it. just add this env variable to your n8n service: RAILWAY_RUN_UID=0 then redeploy and it should work
Hope this help you :)
5 Replies
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Open Railway • about 2 months ago
2 months ago
Hello fuad47,
your issue is that the n8n image runs as a non-root user but railway mounts volumes as root so the node user can't write to it. just add this env variable to your n8n service: RAILWAY_RUN_UID=0 then redeploy and it should work
Hope this help you :)
2 months ago
This error usually means n8n is trying to create its data directory, but the mounted volume lacks the right permissions for the node user inside the container.
Since your mount path is /home/node/data, n8n tries to create:
/home/node/data/.n8n
It cannot write there, causing the deployment to crash with EACCES: permission denied.
Here are a few things to check:
1. Ensure the mounted volume is writable by the container user.
2. In many setups, n8n expects the data folder to be owned by the node user.
3. You can also try mounting directly to the default n8n data path instead of a parent folder, depending on your platform.
Regarding your second question: if your main goal is to avoid losing workflows and execution data on redeployment, then yes, you need persistence.
A *volume mount** is sufficient if you are using the default SQLite database and want simple persistence.
* PostgreSQL is better for a more reliable production setup, especially long term.
So:
If you want the simplest solution on the Hobby plan, use a *persistent volume** and ensure permissions are correct.
* If your platform easily supports PostgreSQL, that is usually the better option for durability and scaling, but it's not strictly required just to keep workflows after redeployment.
In short: you do not need PostgreSQL just to prevent data loss, but you do need either a working persistent volume or an external database. Right now, your issue seems to be a volume permission problem, not an n8n bug.
jigyasu2004
This error usually means n8n is trying to create its data directory, but the mounted volume lacks the right permissions for the `node` user inside the container. Since your mount path is `/home/node/data`, n8n tries to create: `/home/node/data/.n8n` It cannot write there, causing the deployment to crash with `EACCES: permission denied`. Here are a few things to check: 1\. Ensure the mounted volume is writable by the container user. 2\. In many setups, n8n expects the data folder to be owned by the `node` user. 3\. You can also try mounting directly to the default n8n data path instead of a parent folder, depending on your platform. Regarding your second question: if your main goal is to avoid losing workflows and execution data on redeployment, then yes, you need persistence. _A_ \*volume mount\*\* is sufficient if you are using the default SQLite database and want simple persistence. \* **PostgreSQL** is better for a more reliable production setup, especially long term. So: _If you want the simplest solution on the Hobby plan, use a_ \*persistent volume\*\* and ensure permissions are correct. \* If your platform easily supports PostgreSQL, that is usually the better option for durability and scaling, but it's not strictly required just to keep workflows after redeployment. In short: you do not need PostgreSQL just to prevent data loss, but you do need either a working persistent volume or an external database. Right now, your issue seems to be a **volume permission problem**, not an n8n bug.
2 months ago
how to check default n8n data path ?
domehane
Hello **fuad47,** your issue is that the n8n image runs as a non-root user but railway mounts volumes as root so the node user can't write to it. just add this env variable to your n8n service:` RAILWAY_RUN_UID=0` then redeploy and it should work Hope this help you :)
2 months ago
i think this was first and quickest solution.
2 months ago
Thanks for your solution.
Status changed to Solved brody • about 2 months ago

