So when i updated last time, I had an issue with the encryption key being changed and I had to enter the credentials again. Didnt know I had to save things or copy key before I upgraded. Now i see there is a new version available and want to make sure I do things correctly this time.
I recently did the n8n setup a while back and don’t remember how I did it and what instructions i followed to do the setup.
Thanks for posting here and welcome to the community!
If I understand you correctly, you are looking to upgrade n8n without losing your encryption key or having to re-enter your credentials, right?
n8n creates a random encryption key automatically on the first launch and saves it in the ~/.n8n folder.
I’d recommend to do the update first and then start the service with your encryption key set.
Before updating, it’s always a good idea to backup your current .env file (and any other configuration files you might have).
In your docker compose file you can set the environment variable as below:
N8N_ENCRYPTION_KEY=your_encryption_key_here
Then, you can run the following commands in the directory containing your docker-compose.yml.
docker-compose pull n8n
docker-compose up -d
This will pull the latest n8n image and restart your service with the new version, using the existing .env configuration. (-d stand for “detached mode” to run the container without blocking your terminal.)
I hope this helps and please do let us know you get on!