Hi, I am using CyberPanel. I am hosting n8n for myself in one of my subdomain. The issue I am facing is whenever there is an update I has to delete the old n8n and pull the latest version and then build the whole container a fresh.
so, all of my old data is lost every time there is an update.
I guess there is a way to update it properly that I don’t know of. I am completely noob here, as you guys already understand that.
Please help
Thank You
P.S: is there any complete guide to setup n8n in Cyber Panel properly?
I’ve never used CyberPanel I am afraid but this sounds like you don’t have a persistent volume configured for your n8n docker container. Are you running n8n via Docker on your machine running CyberPanel? If so, you might want to check how to configure volumes for your Docker containers using CyberPanel (this way you’d probably find more results compared to searching for n8n specifically).
Without using CyberPanel as an additional layer it’d be as simple as setting the -v ~/.n8n:/home/node/.n8n option from our documentation when executing the docker run command. This would make your local ~/.n8n folder available inside the container as /home/node/.n8n, meaning this folder (and all the data inside such as your workflows) will survive the container recreation that typically happens during an update.
Hey @Abac_Tech, which options did you use for the last command from your screenshot? Did you include the -v /root/n8n/.n8n:/home/node/.n8n which seems to be what you have configured in your CyberPanel screenshot? I reckon once you add this your workflows might be back
There might also be more elegant ways in CyberPanel to create a new container with the latest version will keeping all volumes, but that’s a question better asked in their respective community.
It is also worth adding… Does the user running the container from CyberPanel have access to the /root directory on the server? It could just be that docker doesn’t have access to the root home directory so ignores it and keeps it internal.
You could test this by logging into the Cyberpanel box and check what user is running the container then su to that user and see if you can touch a file in /root.
Hi @Jon actually I am the only user here, and I am using it as a root user. and in my cyber panel there’s also only 1 user that’s me and it’s root user if I am not wrong.
Is docker / cyber panel running as root as well? Normally you would run services as a system user rather than root so it is always worth checking that it isn’t using say a docker user for docker and www-data or similar for cyber panel.
Inside the container shouldn’t matter it is outside of the containers on the OS itself. If you look at that second one for the node process though it isn’t root it is cyberpa+ which I suspect is the OS user running the container.
Can you check on the actual OS to see what user is running docker, if it is cyberpanel you will need to change the OS folder to one that the user can access.
Normally it would be a case of running the ps command to find out but the docker process itself should run under root but I am thinking the command to actually launch the container was done as a cyberpanel user so it might be worth starting with a cat /etc/passwd | grep cyber
When you installed Cyberpanel did you just run the script they provide? I can set aside some time to give it a go.