N8n on raspberry pi 4 B doesn't save workflows

Hello,

Welcome n8n community. This is my first message, so I’m pretty excited. Also, I’m new in this whole n8n thing, but after I saw and heard about this and I like it alot.

I’ve installed n8n on my Raspberry Pi 4 model B. I run it with command:

docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/root/.n8n n8nio/n8n:0.78.0-rpi

After this I get a message:

UserSettings got generated and saved to: /home/node/.n8n/config
n8n ready on 0.0.0.0, port 5678
Version: 0.78.0

Editor is now accessible via:
http://localhost:5678/

Press “o” to open in Browser.

It works fine but the problem is that when I save my workflow and restart docker - my saved workflow is lost. What to do that I can save and open my workflow after restart my PI and/or docker?

Welcome to the community @velkan!

First, it looks like you are using a very old n8n version (0.76.0, the current version is 0.97.0). Not that this is the problem but would still recommend updating.

Now to your actual problem. The Pi image expects a different path. The reason is that the original n8n docker image did run n8n as “root” and got updated later to run as “node” instead. To not break for existing user, did we make sure it works with both paths. The Pi image however got much later and then directly only for the “node” user. Meaning the path is not /root/.n8n it is /home/node/.n8n . Meaning you have to run the following instead:

docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n:0.97.0-rpi

Hope that helps!

1 Like

@jan Thank you for kind words of welcome and useful answer!

Well, I’ve used your command and it looks like it doesn’t work for now. After type this, I get this message:

docker run -it --rm --name n8n -p 5678:5678 -v ~/.n8n:/home/node/.n8n n8nio/n8n:0.97.0-rpi
Unable to find image ‘n8nio/n8n:0.97.0-rpi’ locally
0.97.0-rpi: Pulling from n8nio/n8n
cfc77fa15d77: Pull complete
6c1d24dbd0f8: Pull complete
90255e5a0a93: Pull complete
55d3541348c2: Pull complete
30b2be429d7b: Pull complete
65aac465a8b7: Pull complete
7946972b4866: Pull complete
b737c88bd395: Pull complete
073e51dc8d79: Pull complete
3ee23e904f74: Pull complete
fbbde22b531b: Pull complete
a5fae968c021: Pull complete
Digest: sha256:bc72f58557516eaf01dacb8c353c5b3e75a4418b11f40c865b7f1b1ea6170fc4
Status: Downloaded newer image for n8nio/n8n:0.97.0-rpi
UserSettings got generated and saved to: /home/node/.n8n/config
(node:8) UnhandledPromiseRejectionWarning: Error: There was an error: EACCES: permission denied, open ‘/home/node/.n8n/config’
at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23)
at /usr/local/lib/node_modules/n8n/dist/commands/start.js:134:22
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v17.8.0 Documentation). (rejection id: 1)
(node:8) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8) UnhandledPromiseRejectionWarning: Error: SQLITE_CANTOPEN: unable to open database file
(node:8) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v17.8.0 Documentation). (rejection id: 2)

Do you know how to fix this?

That has to do with the access rights to the file. You can try to simply open them up with:

chmod 777 -R ~/.n8n
2 Likes

Thank you, it’s working!

Glad to hear! Have fun!