Bootstrap owner account

Describe the problem/error/question

Is there anyway of bootstraping the owner account without going through the n8n app interface? (E.g with environmental variables, API call, CLI etc.)

What is the error message (if any)?

Please share your workflow

Trying to automate the deployment of n8n in my cluster.

Share the output returned by the last node

N/A

Information on your n8n setup

  • n8n version: latest
  • Database (default: SQLite): PostGres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): k8s
  • Operating system: N/A
1 Like

Hi @1000p , welcome to the n8n community :tada: !

At the moment there isn’t an official way to bootstrap the owner account via environment variables, API, or CLI. The first user (owner) is normally created through the initial setup screen in the UI. User management | n8n Docs

That said, a common workaround is to pre-seed the database with a user. The onboarding flow only appears when the user table is empty, so if a user already exists, n8n skips the setup screen. Two approaches I’ve seen used: Run n8n once, create the owner account, then reuse that postgres database snapshot for future deployments; or Some teams insert the user record directly in the database as part of their infrastructure provisioning step.

Hii @1000p Welcome!
You can try that using the n8n’s official public API, POST /users endpoint to create users or you can try using the command n8n user-management:reset , although currently there is no direct ENV variable i can think of which can fully pre configure the account.

You can try these:

@tamy.santos , @Anshul_Namdev , thanks for the replies and the welcome guys.

So, today I found my solution by browsing the n8n repository. I found that there is a REST endpoint where you can POST your owner details, supposedly used by the CLI - n8n/packages/cli/src/controllers/owner.controller.ts at master · n8n-io/n8n · GitHub

I used that with a k8s job that spins an init container watching if the main n8n deployment is ready, then another container which makes the post request. This pretty much automated what I needed for now.

Thanks for the feedback

1 Like