Skip to content

Create the first administrator

The server administers itself. There is no seeded password to look up in a log and no create-admin command. The first administrator is created from the browser, once.

  1. Open /admin on a freshly provisioned deployment, for example http://localhost:3000/admin.

  2. The Create the first super admin screen asks for an e-mail address and a password of at least twelve characters. The account goes into the reserved “Administrators” project, is made a member of Super administrators (the team whose members administer the whole instance) and gets a personal team like any other administrator.

  3. Submit. If the server has no keyring yet, the next screen, Save the instance keyring, shows the one setup has just generated. The keyring step below explains it.

  4. Sign in with those credentials.

The setup route closes as soon as Super administrators has an active member, and answers 409 already_initialized from then on. /admin becomes a sign-in.

Further administrators are created on the console’s Administrators page with New administrator, an e-mail address and a password of at least twelve characters. A super administrator can also open sign-up on that page’s Sign-in tab, so that people register themselves, or connect your organisation’s identity provider under Identity providers. Sign-up opens only together with e-mail verification, in the same change. Without verification, anyone could register an administrator account under a colleague’s address.

A new administrator is never a super administrator, however they arrived. A super administrator grants that separately, with Make super administrator… in the account’s menu. (Membership of a regular team is offered by e-mail invitation.)

If you reach a setup screen on a deployment that is supposed to have administrators, investigate: it means the account collection this server reads holds none.

The server encrypts the secrets it stores with a keyring: a key that you hold outside the database. The secrets include application secrets, sign-in provider credentials, the mail password, private signing keys and authenticator secrets. A copy of the database is then of no use for reading them without the keyring.

If you supplied no keyring, setup generates one after it creates your account. The server never does this silently at startup. What happens next depends on whether the keyring directory exists:

  • It exists, for example because the shipped Compose files mount a volume there, or because you ran mkdir keyring before a run from source. Setup writes the keyring file there, and the server uses it at once.
  • It does not exist, as on Fly.io. The keyring is not in use yet. Set it as the KEYRING secret of your deployment and restart. Until then, secrets stay unencrypted.

Either way, the screen shows the keyring only this once, with Copy and Download buttons. Save it in a password manager or a secrets manager, apart from your database backups. The secrets in a backup cannot be read without it. Continue stays disabled until you tick I have saved this key apart from my database backups.

Until the keyring is in use and its backup is confirmed, the console reminds super administrators on every page. The Encryption at rest card on the Keys page shows its state. On an instance that was set up before this step existed, a super administrator generates a keyring in that card. The keyring covers each platform, rotation, and what to do if a key is lost.

The admin console after sign-in, listing the projects of the current team.
What a signed-in administrator lands on: the projects of the team the scope switcher is pointed at.

Administrators sign in through this server’s own issuer

Section titled “Administrators sign in through this server’s own issuer”

Signing in to the console is an OpenID Connect authorization code flow against the same server the console administers, using the first-party admin-panel client that db:setup seeds. There is no second password store and no admin-only credential path: an administrator is an end-user in the reserved administrators’ project, and what the admin API lets them do follows from the teams they belong to.

Two consequences follow, and both come up in practice:

  • The seeded client’s redirect URI is $ISSUER/admin/callback, written once when the client is first inserted. If ISSUER changed after the seed, sign-in redirects to a URI the client does not have and fails; re-running db:setup does not update the redirect URI. See the Compose guide’s warning for what to do about it.
  • The console cannot be reached without the seed. If db:setup never ran, /admin/login redirects to /auth with a client_id no client matches.

The administrators’ project is a password door on the public internet, so our advice is to require an authenticator app on it before you do anything else. In the console, go to Administrators (super administrators only), open the Sign-in tab, switch on Require an authenticator app for password sign-in and save. The console first shows how many administrators have no authenticator yet and asks you to confirm.

Signing in then needs a six-digit code as well as a password. Turning the requirement on locks nobody out: administrators without an authenticator enrol one at their next sign-in. That includes an agent signing in with the reserved admin-mcp client that db:setup seeds, since it uses the same door. Administrators who sign in through an identity provider use that provider’s second factor instead; the requirement applies to password sign-in only.

The second factor, not the login throttle, is what makes this door properly hard. The throttle counts failed password attempts per project and e-mail address, and refuses an address that reaches the cap for a while. Each further lockout is normally longer. A project that requires a one-time code stays at the first lockout length however often it is tripped, by design: a guessed password there does not sign anyone in. Administrators also have no self-service password reset to escape a lockout with. The throttle’s own settings are loginThrottle.failureCap, loginThrottle.windowSeconds and loginThrottle.windowCeilingSeconds in the settings reference.

The server sends mail to verify addresses, reset passwords and invite people. Until mail is set up, none of that works, and administrators’ sign-up cannot open.

  1. Open Settings → Integrations and fill in Email (SMTP): the host and port of your mail provider, the login and password, and the sender’s name and address. Many providers accept only a sender address that matches the login or one of its aliases.
  2. Press Save, then Send test email. The message goes to your own address.
  3. If the mail server refuses, the card shows its reply, for example 535 Authentication failed. If it accepts the message but nothing arrives, look in spam and check the SPF, DKIM and DMARC records of the sender’s domain.

An agent does the same with smtp_settings_update and smtp_settings_test.

The console’s super-admin surface covers the instance itself: server settings, signing keys, SMTP, administrator accounts and the fault store. Being a super administrator is membership of the reserved Super administrators team. That membership is granted and withdrawn as operations of their own: Make super administrator… and Withdraw super administration… on the Administrators page, or admin_super_grant and admin_super_withdraw for an agent. The last active member can be neither withdrawn nor deactivated.

Any other administrator creates projects, the applications and APIs in them, and teams. They invite people into their regular teams by e-mail, and read the audit trail and Usage for their own teams. Ownership is by team: belonging to a project’s owning team is what grants access to it. Teams and project ownership has the details.

Every state-changing action, the console’s and an agent’s alike, is written to an append-only audit trail before the mutation, naming the actor, the action and the target. The store exposes no update or delete.

If you find a security problem rather than a configuration one, our disclosure policy and contact are on the security page.