Self Host Wizard Docs

Passwords (vaultwarden)

Passwords on a Self Host Wizard box: the vaultwarden piece, served at vault.<apps domain>, oidc sign-in, memory limit 163 MB.

At a glance

FieldValue
Addresshttps://vault.<apps domain>
Sign-inoidc: OpenID Connect through Authelia: the office sign-in carries over
Memory limit163 MB (ram_mb: measured peak × 1.3)
Databasenone shared: it keeps its own data in THX_DATA
Needslldap, authelia
Needed bynothing
Containersvaultwarden
Image: vaultwardenvaultwarden/server:1.37.5-alpine@sha256:bbe684a02d6b0db54256ff88eac9754f4519284a7b26314afc241fd7d0918191
Licence (from the README)AGPL-3.0
Upstream (from the README)https://github.com/dani-garcia/vaultwarden

Turn it on

thx enable adds vaultwarden and everything it needs to the box's state; thx apply then installs it. Apps are applied only once site_domain is set.

sudo thx enable vaultwarden
sudo thx apply

Engineering notes (pieces/vaultwarden/README.md)

Vaultwarden 1.37.5, AGPL-3.0: a Bitwarden-compatible server in Rust. Every official Bitwarden app (browser extension, desktop, iOS/Android, bw CLI) and the bundled web vault talk to it. Image vaultwarden/server:1.37.5-alpine, pinned by index digest sha256:bbe684a0…8191; the index has linux/arm64 (docker buildx imagetools inspect, 2026-11-24). We ship only compose + config and pull the upstream image unmodified.

How it is wired

  • Storage: SQLite and attachments in THX_DATA (/data in the container).
  • Sign-in: SSO through Authelia, and only SSO. Vaultwarden has OpenID Connect SSO since 1.35; verified in the 1.37.5 sources (src/sso.rs, src/api/identity.rs, .env.template). SSO_ONLY=true refuses the password grant ("SSO sign-in is required"); SIGNUPS_ALLOWED=false refuses self-registration; SSO_SIGNUPS_ALLOWED=true lets any LLDAP person who passes Authelia get an account on first sign-in. Redirect URI: https://vault.<apps_domain>/identity/connect/oidc-signin; Vaultwarden uses client_secret_basic and always sends a PKCE S256 challenge.
  • The master password stays. Bitwarden encrypts the vault on the device with a key derived from the master password; SSO replaces only "who are you". On the first SSO sign-in each person sets a master password in the app; after that they sign in with SSO and unlock with the master password. This is by design (PLAN §2.2 "own master password") and it is what keeps the box operator from reading anyone's passwords.
  • Login is automatic ([oidc] login_page = "/", login_start = "/#/sso?identifier=…", Caddy; docs/pieces.md section 4). Opening https://vault.<apps_domain>/ from outside goes straight into the web vault's SSO step; with an Authelia session it comes back with no click, without one it goes through Authelia's form once. The person lands on the one screen only they can pass: setting their master password (first visit; the account is made then) or unlocking with it. The identifier is Vaultwarden's FAKE_SSO_IDENTIFIER (00000000-01DC-01DC-01DC-000000000000, src/sso.rs): with any other value the set-password screen asks /organizations/<identifier>/policies/master-password, gets 401 and drops back to the login page.
  • The one extra password, explained on screen. templates/scss/user.vaultwarden.scss.hbs (mounted read-only, TEMPLATES_FOLDER=/thx-templates; Vaultwarden appends it to its CSS) puts a line on the set-password and unlock screens: you are already signed in to the office; this password is only for the vault, locks it on this device so nobody else (server, administrator) can read it, and cannot be reset. It also hides upstream's "Join organization" heading on the set-password screen (that organization is the SSO placeholder; there is none). The vault stays zero-knowledge: the server never sees the master password or the keys.
  • SSO_AUTH_ONLY_NOT_SESSION=true: Vaultwarden keeps its own session/refresh tokens. Otherwise every client would be signed out when Authelia's 1-hour access token expires.
  • Clients: in any Bitwarden app choose "self-hosted", server https://vault.<apps_domain>, then "Enterprise single sign-on" (any identifier works). The bw CLI and scripts use the personal API key (bw login --apikey), which SSO_ONLY still allows.
  • Live sync (WebSocket): since 1.29 notifications are served on the main port at /notifications/hub; a plain reverse_proxy in Caddy carries the upgrade. No extra route needed.
  • Admin panel: /admin, token THX_SECRET_ADMIN_TOKEN (64 hex chars). Vaultwarden logs a notice that a plain token is weaker than an Argon2 PHC hash. See "Needs from other lanes".
  • Mail: THX_SMTP_HOST:THX_SMTP_PORT, SMTP_SECURITY=off (the hop never leaves the thx network), from THX_MAIL_FROM. Used for organization invitations and new-device notices.

One Bitwarden Organization per company: not automated, on purpose

An Organization's key is generated on a member's device and handed to each new member encrypted with that member's public key (the "confirm" step). The server never holds it. A job on the box could only create and fill organizations by running a bot account that holds every company's organization key, which means the box (and whoever has root on it) could decrypt every shared password of every company. That defeats the point of Vaultwarden. Nor does upstream map OIDC groups to organizations (the SSO code has no group handling in 1.37.5).

What works today, by hand, per company: the first person signs in, creates the Organization ("Acme") in the web vault and invites colleagues by email; they sign in with SSO, set their master password, and the inviter confirms them. Owner decision needed (recommendation: keep it manual, document it in the admin guide).

Test (./test.sh)

Throwaway LLDAP, Authelia (client generated from piece.toml), Caddy with its local CA (the container trusts it through a mounted CA bundle, test-only), Mailpit as the relay. It checks: the password grant and self-registration are refused; alice signs in through Authelia with the same authorize → oidc-signin → token flow a Bitwarden client uses, and gets a fresh account without keys; the test sets her master password the way a client does (PBKDF2-SHA256 600k master key, HKDF stretch, AES-256-CBC + HMAC user key, RSA-2048 key pair) and creates her API key; the **official bw CLI 2026.10.1** (node:22-alpine, pinned) logs in with the API key, unlocks, creates a login item and reads it back after a sync; a WebSocket opened through Caddy gets the SignalR handshake and a push message when the CLI saves the item; the item fetched over the API decrypts with alice's key to the same secret; in headless Chrome (test/sso.py), bob (Authelia session, no account yet) opens the vault and lands on the set-master-password screen with no click, alice (master password set) lands on the unlock screen, carol (no session) signs in at Authelia once and lands on the set-password screen, each with the explanation on screen; the admin token opens /admin (a wrong one gets 401) and its SMTP test mail arrives in Mailpit from THX_MAIL_FROM.

RAM

Measured 2026-11-24/25 on the amd64 dev PC (the box is arm64; same Rust binary, expect similar), page cache excluded, while the bw CLI synced and a WebSocket stayed open: peaks of 78, 92, 78, 51 and 69 MiB over five runs (the first three by docker stats every 2 s, the last two from the cgroup every 0.25 s; cgroup memory.peak 64–97 MiB incl. page cache). With the web vault's SSO sign-ins in headless Chrome added (sso lane, 2026-11-25; three people, each through the full SSO flow, two web-vault sessions syncing) the peaks were 91, 110 and 125 MiB (cgroup every 0.25 s). ram_mb = 163 = 125 × 1.3, rounded up; mem_limit: 163m. The test asserts no OOM kill under that limit. It has three users and one item; re-measure on the box under real use (many devices holding WebSockets, attachments).

Needs from other lanes

  • Caddy (core): gate /admin* on vault.<apps_domain> to the admins group (forward_auth to Authelia) on top of the token, and proxy the rest straight through (WebSocket upgrade included).
  • Secrets (core): store admin_token as an Argon2id PHC string (vaultwarden hash) and hand the admin the plain value once; Vaultwarden accepts either form in ADMIN_TOKEN.
  • Authelia (core): the client as generated from piece.toml (client_secret_basic, PKCE S256, consent_mode: implicit); containers must resolve and reach https://auth.<apps_domain>.

Known gaps

  • Organizations per company are manual (above).
  • People removed from LLDAP keep their vault account until an admin disables it in /admin; with SSO_ONLY they can no longer sign in, but devices already signed in stay unlocked until their refresh token expires.
  • The emergency-access and Send features are upstream defaults (on); nothing here changes them.

Facts on this page come from these files in the selfhostwizard repository:

  • pieces/vaultwarden/piece.toml
  • pieces/vaultwarden/compose.yaml
  • pieces/vaultwarden/README.md
  • internal/piece/piece.go

This page is generated from the code at build time, so it changes when the code does.