Credentials lost after n8n Docker restart even with external Postgres DB

I’m running n8n in Docker with an external Postgres database configured. However, whenever I restart the n8n service, all of my credentials are lost and I have to manually set them again.

Has anyone else faced this issue? Is there a recommended way to ensure credentials are preserved across restarts when using an external Postgres DB?

Any guidance would be really helpful.

1 Like

To fix it, define a strong N8N_ENCRYPTION_KEY in your docker-compose or container environment, make sure your Postgres DB has the right migrations applied, and avoid using ephemeral volumes for /home/node/.n8n. With a stable encryption key and proper DB config, credentials will persist across restarts.

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