[Solved] Docker migration n8n

Describe the problem/error/question

I would like to migrate my N8N docker on a new server. Both are on Debian 12.
I tried a lot of different method, but no success.
Last one was thanks to this video

1/ I done a commit of my container :

sudo docker commit ContainerID

2/ Saved this image :

sudo docker save ImageID > backup.tar

3/ I created a backup of my volume in /var/lib/docker/volumes

sudo zip -r n8nDataBackup.zip n8n_data

4/ backup.tar and n8nDataBackup.zip to my new server

5/ sudo docker load -i backup.tar

6/ sudo docker volume create n8n_data

7/ unzip n8nDataBackup.zip -d /var/lib/docker/volumes

So now, my n8n_data volume and the image n8nbackup are ready

8/ sudo docker run -it --rm --name n8n -p 5678:5678 -e GENERIC_TIMEZONE="Europe/Paris" -e TZ="Europe/Paris" -e N8N_PAYLOAD_SIZE_MAX=2024 -v n8n_data:/home/node/.n8n n8nbackup

Finally, error message :

Error: EACCES: permission denied, open '/home/node/.n8n/crash.journal'
Error: Exiting due to an error.
Error: EACCES: permission denied, open '/home/node/.n8n/crash.journal'

How I could solve this please

Information on your n8n setup

  • n8n version: 1.18
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Debian

I solved my issue, thanks to N8n Docker on ubuntu 22.04 keep restarting - error permission denied - #3 by Jon

I used the command
docker run --rm -it --user root -v ~/.n8n:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n
but the volume folder was wrong

So the final good command is:

docker run --rm -it --user root -v n8n_data:/home/node/.n8n --entrypoint chown n8nio/base:16 -R node:node /home/node/.n8n

And my container starting now :slight_smile:


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