Self-Host | Docker | Issues

Hello! So I am a new user to n8n and I am running in a annoying issue, I’ve used an tested n8n self–hosted by docker for the past few weeks, I had quite some issues setting it up firstly but eventually got it working, the big issue is when I tried to update it today I ended up deleting the container I was running it in, and looks like I didn’t have a proper volume setup.

So I am trying to make a fresh install on docker and what happens (and the reason my volume was not saved) it’s that everything works perfectly after I use the command on my terminal however when I close docker, the container is deleted, I lose all my progress and when I try to make a new container from the image it doesnt have anything saved because the volume is not active anymore… I tried to find the .n8n folder but I have nothing on my PC…

I noted I get this error

How can I fixed this? I searched everywhere and looks like it isn’t a problem many people run into… I’m completly new to docker and all this container/image/volume thing… But I guess there should be a .n8n folder somewhere to store my volume and load it in further containers so I don’t lose all my workflow like I just did…

Information on your n8n setup

  • **n8n version:latest
  • Database (default: SQLite): default
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):defait
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):docker
  • **Operating system:windows

Hey @Joao_Marques , what docker command do you use to create the container? Did you follow the guide on Docker | n8n Docs?

If container is deleted it likely means you use --rm options with the command. If you want the container to persist after you stop it, do not use those options.

Regardless, it cannot affect the volume if you have created it and mounted to your container. The volume persists no matter what you do with the container.

1 Like

Yeah the --rm was the issue the thing is probably because lack of knowledge I was having trouble using the volume into a new container, so everytime I tried to run the image I was getting a fresh volume.

I’m having the same issue for example with updating the image, when I do de “pull” it creates a new image called “none><none” and assigns it to the container, but when I run it (even on a new container) the update didn’t go trough and I end up losing the volume because I change container.

Thanks a lot for the answer :slight_smile:

Hey @Joao_Marques. It sounds like you need to upskill yourself in Docker usage. The issue you experience comes from misunderstanding how Docker works.

When you pull the image (latest version), your container (if persist) does not get affected. It is built on the older image. To use this new image you need to create a new container using the very same data volume.

If you use the consist container name, for example --name n8n, that means you have to delete (or rename) the old container as you cannot create a new one with the very same name.

I normally run container like this

docker run -d \
  --name n8n \
  -p 5678:5678 \
  -e GENERIC_TIMEZONE="Etc/GMT" \
  -e TZ="Etc/GMT" \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n:latest

This means the container does not get deleted when I stop it.

When it is time to upgrade, I pull the image, delete this container, and run the same command again. The volume “n8n_data” remain the same and so are all the workflows and credentilas I used with the old container.

2 Likes

Yeah I really need to upskill, will search for some online courses :slight_smile: Thanks a lot for the help again, and congrtz on the amazing software and community you guys building up here. It’s been incredable to work with n8n :slight_smile:

1 Like