Db connections and shared config values when deploying Production/Dev instances

Describe the problem/error/question

Hi Team, I’m in the middle of setting up separate development and production environments for our self-hosted n8n instance. I have a few questions about the setup the docs were a little unclear on:

  1. Are we meant to use separate databases for the dev and prod environments? Or are we supposed to give the dev instance the same connection as the production instance?
  2. How do we activate the dev instance? Post install, obviously the dev instance is in community edition mode. Do I just re-enter our subscription key, or is there a different process?
  3. Are there any other required environmental variables that the 2 copies are meant to share? Like in queue mode we have to use the same encryption key, is it the same for this setup?

What is the error message (if any)?

No error, just looking for clarity and direction.

Information on your n8n setup

  • n8n version: Version 1.31.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): self hosted in a Google Cloud Kubernetes Cluster
  • Operating system: k8s

Hey @tipsykat,

Each environment would have its own database, it can be on the same database server but make sure the database itself is different, as the database is different you can use different encryption keys and if your license allows it you can just apply the same license to your test instance.

DON’T DO THAT. Different environments should never use the same encryption keys or share the same credentials. Otherwise, if you have lost/got compromised your dev instance, you’ll also affect the production.