[Feature] Allow declarative first-admin bootstrap via config/env (headless setup)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- authentication, backend
Research direction
Start by grepping for DISABLE_SETUP_WIZARD to find where the setup-wizard flag is read and where the first admin is currently created, then look at the config.yml loader and the POST /api/users handler for the existing user-creation path. The issue names no files, so the first job is mapping env/config parsing to the admin-creation code and confirming how "no admin exists yet" can be checked. Done means the three proposed credentials (or a config.yml block) create an admin only on an empty database, fail closed on partial configuration, never log secrets, and are covered by tests for the idempotent and partial-config cases. Treat this as a design discussion first: comment on the issue to agree the config surface before writing code.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
Automated/deployment-code RomM setups cannot create the first Admin without a UI click. On an empty database, RomM redirects every page to the Setup Wizard; the docs state the resulting account "is always an Admin, regardless of any env var". DISABLE_SETUP_WIZARD=true skips the wizard for automation, but the operator is then told to "create the first admin via the API or by injecting a database row at deploy time". The API route needs a running, reachable, authenticated-enough instance and a post-start orchestration step; the DB-row path is unsupported and brittle. There is no environment variable or config.yml key for the initial admin.
Describe the solution you'd like
An optional, idempotent declarative first-admin bootstrap, e.g.:
ROMM_INITIAL_ADMIN_USERNAMEROMM_INITIAL_ADMIN_EMAILROMM_INITIAL_ADMIN_PASSWORD_FILE(path to a file; never a literal secret in env/config/logs)
or an equivalent block in config.yml. Semantics: create the Admin only when no admin exists (no-op otherwise); fail closed on partial configuration; never log or echo values; remain compatible with OIDC-only setups. This would let GitOps/host-config workflows provision RomM fully from code, including the first login.
Describe alternatives you've considered
POST /api/usersafter startup — works in principle (POST /api/users, bodyusername,email,password,role: admin), but requires a post-start script, a reachable URL, and assumptions about auth/CSRF that are not documented.- Injecting a row into MariaDB at deploy time — explicitly mentioned in the docs but unsupported and fragile.
- OIDC auto-provisioning — documented (
OIDC_ALLOW_REGISTRATION,OIDC_ROLE_ADMIN), but still requires a login event and does not cover non-OIDC deployments. - Keeping the Setup Wizard — fine interactively, blocks unattended provisioning.
Additional context
- RomM 5.4.0 docs — Invitations & Registration: https://docs.romm.app/5.4.0/administration/invitations-and-registration/ ("The resulting account is always an Admin, regardless of any env var." / "To skip the wizard (e.g. when provisioning via automation and you'll create users through the API), set: DISABLE_SETUP_WIZARD=true" / "You'll then need to create the first admin via the API or by injecting a database row at deploy time, because the UI won't offer a setup flow.")
- RomM 5.4.0 env vars: https://docs.romm.app/5.4.0/reference/environment-variables/ — no initial-admin credential key exists.
- OpenAPI (public spec):
GET /openapi.json,POST /api/usersrequiresusername,email,password,role;Roleenumuser|admin. - PR https://github.com/rommapp/romm/pull/2495 added
DISABLE_SETUP_WIZARD(merged; intended mainly for OIDC setups). - Issue https://github.com/rommapp/romm/issues/2346 discusses initial-admin creation under OIDC.
- Duplicate search performed 2026-11-20 for "initial admin bootstrap config file", "DISABLE_SETUP_WIZARD", "first admin env variable", "headless setup", "initial admin creation": no open duplicate found (search results: #5465 closed bug, #2673 closed OIDC scope, #2346 closed OIDC RBAC).
- Dominant language
- Python
- Stars
- 13.3k
- Forks
- 747
- Avg merge
- 20h 58m
- Merged PRs (30d)
- 207
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rommapp/romm
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rommapp/romm#5857 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
rommapp/romm#4178 · 1 reaction ·
Maintainers usually reply within 1 day
-
[UI/UX] Misaligned number in searchPossibly taken @NevesHenry claimed this today. Openui/ux
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
Maintainers usually reply within 1 day
-
[Bug] Games do not show up in search if more than 2 letters are used.Possibly taken @andest01 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
rommapp/romm#5853 · 7 comments ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
web-push-libs/pywebpush#216 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AgriciDaniel/claude-seo#572 ·
Maintainers usually reply within 5 days
-
area:print-dispatch
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
area: docs domain: technical-writing good first issue type: documentation
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Deepak3699/Ai_Mentor#919 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day