Skip to content

vaultwarden

Vaultwarden, the self-hosted Bitwarden server, as its project publishes it, for a dotdash relay's or server's site. Visitors and probes that open the domain find a password manager's login page, the same page as on the 14,000 to 18,000 other Vaultwarden installs scanners count on the internet, rather than an app only dotdash sites run.

Nothing of this repository is in it: the image is upstream's, unmodified, pinned by tag and digest in bundle/manifest.yaml, with upstream's look, and the page's language follows the visitor's browser, as on any install. Renovate proposes each new upstream release. The bundle sets only what keeps everything but the login page closed, and joins the site's network.

It uses about 11 MiB of memory idle and at most 33 MiB under load on a rig (limit 64 MiB), keeps a SQLite file with no accounts in its volume, and runs on amd64 and arm64. The image is 311 MB unpacked.

What a stranger can reach

  • The login page, at /: upstream's web vault, as on any install. Every sign-in fails, as there are no accounts. Upstream counts the tries: ten a minute per address (LOGIN_RATELIMIT_*, its defaults), then 429.
  • No signup: SIGNUPS_ALLOWED=false, which /api/config tells the page. The first step of a signup, /identity/accounts/register/send-verification-email, answers 400, "Registration not allowed", and the last one needs the token only that step or an invitation hands out. With signups open, the first step hands any stranger that token.
  • No invitations: INVITATIONS_ALLOWED=false, and inviting needs an account anyway.
  • No admin panel: no ADMIN_TOKEN is set, so /admin answers, as on most installs, "The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it", and every page under it is a 404.
  • No first-run page: Vaultwarden has none.
  • What every install answers anyone: /api/config (the version, its git hash, its address as https://<domain>, registration off), /api/version, /alive (the time), and an icon per domain at /icons/<domain>/icon.png (here always the blank fallback). Those name the version, so keep it current (below).

What it calls out to

Nothing, as set here: on a rig, it sent no IP packet beyond answers on its own port while it started, served the page, refused signups and logins and answered icon requests.

  • Icons: DISABLE_ICON_DOWNLOAD=true, so a stranger asking for /icons/<any domain>/icon.png makes it fetch nothing.
  • Push to Bitwarden's relay: off, upstream's default (PUSH_ENABLED).
  • Have I Been Pwned from the server: only with HIBP_API_KEY, unset, and for a signed-in account.
  • Mail: no SMTP is set.
  • The admin panel's update and time checks: the panel is off.

What would still call out needs an account, which no one can get: Duo, YubiKey and similar second factors, and a signed-in browser's own calls, such as checking a password against Have I Been Pwned, which go from the visitor's browser, not the server.

Pair it with a relay

Every relay has a site, on dotdash relay 0.29 or later (0.28 needed the own-site profile): a Caddy on the Docker network dotdash-relay_edge, which serves the relay's domain. vaultwarden joins that network as vaultwarden, so the relay's cover parameter points at http://vaultwarden:8080. Caddy then passes the app every request except subscriptions, XHTTP and your own files in /srv/dotdash-relay, which take precedence over the app: keep that directory empty, or a stranger finds files no Vaultwarden has.

domain is the domain the relay's site serves. Vaultwarden names https://<domain> as its address in /api/config; without it, it would say http://localhost, which no install that works does.

Its login limit and its log count the visitor the site in front names in X-Forwarded-For (IP_HEADER). Vaultwarden takes that header only from a private address (IP_HEADER_TRUSTED_PROXIES=local), and only the containers on the site's network reach it: the site's Caddy, which replaces whatever a visitor sent with the address it saw, and any other app on that network. In a list it takes the last public address, so a header a visitor sends could not displace the site's entry even if one were passed on. dotdash 0.18.0 and later name each visitor, except one over HTTP/3 through Hysteria2, or one Docker relays the port for (IPv6 without its NAT); those count as one address.

It also runs on a server: there, set network=dotdash_edge and use --product dotdash for the server's cover.

Install

The relay goes first, dotdash relay 0.29 or later, because it creates the network the app joins.

sudo morzer init --release oci://ghcr.io/morzecrew/dotdash-utils/vaultwarden:stable \
  --set domain=vault.example.com
sudo morzer --product vaultwarden apply
sudo morzer --product vaultwarden status                      # wait for healthy

sudo morzer --product dotdash-relay config set cover=http://vaultwarden:8080

init prints the release's signing key and trusts it from then on. To check even this first release, add --signing-key with the release key this repository publishes.

morzer undoes the last config set if the site cannot reach the app, so run it only once status shows the app healthy. With two installations on the machine, every morzer command names the one it means with --product; sudo morzer shell vaultwarden opens a shell where commands mean this one.

Parameters

Parameter Default What it does
domain required The domain the site in front serves, such as vault.example.com. Vaultwarden names https://<domain> as its address.
network dotdash-relay_edge The site's Docker network: dotdash-relay_edge on a relay, dotdash_edge on a server. It must exist before the app is applied.

There are no secrets: no account and no admin token exist to protect.

Updating

/api/config tells anyone the version, so an install left behind becomes a rare value, and soon a vulnerable one. Each upstream release reaches a relay in three steps: Renovate's pull request moves the pin (merge it once its smoke install passes), main publishes the bundle on the dev channel, and a release tag puts it on stable. Then, on each machine:

sudo morzer --product vaultwarden update      # the newest stable release
sudo morzer --product vaultwarden rollback    # back to the one before

Vaultwarden migrates its SQLite as it starts; an older one starts on a newer one's (1.36.0 on 1.37.5's, on a rig), so a rollback works too.

To remove it, point the site back at its own page first, then remove the installation. installation list shows its id. The data volume stays unless you add --purge:

sudo morzer --product dotdash-relay config set cover=pages
sudo morzer --product vaultwarden installation remove --force --confirm <its inst_… id>