Password Managers guide

Vaultwarden Docker Compose Setup: Secure It Before First Login

Deploy Vaultwarden with Docker Compose, HTTPS, persistent data, disabled public signups, verified clients, and recoverable backups.

Published and reviewed by OpenAlt · September 22, 2026

Close-up of a steel padlock on a mesh fence, symbolizing protection and security.
Photo by Connor Scott McManus on Pexels

Treat TLS, backups, SMTP, and the admin token as operational controls. This sequence keeps a small deployment usable while limiting avoidable exposure.

Table of Contents

This guide covers the decision, preflight checks, Compose configuration, HTTPS, first-account setup, verification, backups, updates, rollback, and failures.

Decide first

Vaultwarden is a lightweight, self-hosted server compatible with Bitwarden clients. It is unofficial and not associated with Bitwarden, so you own storage, HTTPS, backups, updates, and account access. Review the official project README before choosing it.

Use this rule:

A container running on a local port is not a finished password-manager deployment. The public URL, reverse proxy, persistent storage, signup state, and recovery plan all matter.

Preflight

Before creating an account, confirm that:

  • A hostname resolves to the reverse proxy or server publishing Vaultwarden.
  • The final HTTPS URL is known and will match DOMAIN exactly.
  • /data is mapped to durable storage.
  • The proxy can issue and renew certificates.
  • The /data storage is included in a backup plan.
  • SMTP credentials and any admin token have private storage.
  • Public signup can be closed immediately after the first account is created.

The official Using Docker Compose guidance uses /data, sets DOMAIN, and recommends disabling SIGNUPS_ALLOWED after account creation. Make these initial-run controls part of the deployment plan.

Compose file explained

Define one Vaultwarden service, persist /data, set the public DOMAIN, and control signup state through environment settings.

Compose concernDecisionReason
ImageUse the image from the official exampleAligns with project guidance
StorageMount durable storage at /dataPreserves data across replacement
DOMAINSet the exact HTTPS URLKeeps clients and server consistent
SIGNUPS_ALLOWEDEnable only during setupRemoves open registration afterward
Restart behaviorRestart after routine interruptionsReduces manual recovery
NetworkJoin the proxy networkAvoids an unnecessary public app port

Render the configuration first:

docker compose config

Confirm the storage mapping and environment values, then start the service:

docker compose up -d
docker compose ps

A running container proves only that the process started. The proxy, URL, signup, and backup decisions still determine whether the deployment is ready. Use Using Docker Compose as the project baseline.

TLS and reverse proxy

Put Vaultwarden behind an HTTPS reverse proxy before storing real credentials. The proxy must forward normal HTTP traffic and WebSocket traffic, and the public URL must match DOMAIN.

Use this workflow:

  1. Create the DNS record for the hostname.
  2. Configure TLS termination and certificate renewal.
  3. Forward requests to Vaultwarden over the internal network.
  4. Preserve the host and forwarding information expected by the application.
  5. Enable WebSocket support.
  6. Open the public HTTPS URL and inspect the certificate.

Do not use an unencrypted public endpoint as the normal client URL. HTTPS protects credentials in transit and avoids relying on a local-network assumption that may fail for mobile devices, remote users, or shared Wi-Fi. Adapt the relevant configuration from the project’s Proxy examples.

Create the account, then close signups

Create the intended primary account while signups are enabled. Verify it, then close registration:

  1. Start the Compose project with signup enabled.
  2. Open the HTTPS DOMAIN in a browser.
  3. Create the first account with a strong, unique master password.
  4. Sign in and confirm that the web vault loads.
  5. Set SIGNUPS_ALLOWED to false.
  6. Restart or recreate the service so the change is applied.
  7. Confirm that a new registration attempt is rejected.

Closing signup is an access-control step. If another user needs access, use the supported invitation or organization workflow instead of leaving public registration open.

SMTP credentials and the admin token are secrets. Keep them out of screenshots, shared notes, and copied logs. Test SMTP with a controlled account after HTTPS works, because a broken mail path can resemble an authentication problem. Keep administrative access private unless it is intentionally protected; the Proxy examples include relevant security considerations.

An IT professional operates a computer in a server room, managing network systems and connected devices.
Photo by panumas nikhomkhai on Pexels
Detailed image of illuminated server racks showcasing modern technology infrastructure.
Photo by panumas nikhomkhai on Pexels

Verify clients and WebSocket behavior

Verification is complete when the public vault, authentication, synchronization, and WebSocket connection work through the HTTPS hostname.

  1. Confirm docker compose ps shows the service running.
  2. Check docker compose logs --tail=100 for repeating errors.
  3. Visit DOMAIN and confirm the certificate and web vault.
  4. Sign in from a browser.
  5. Connect one Bitwarden-compatible client using the same server URL.
  6. Create a harmless test item and confirm synchronization.
  7. Test outside the local network if remote access is required.
  8. Inspect browser or proxy diagnostics for WebSocket failures.

A page that loads does not prove live synchronization works. If clients connect but changes lag, inspect proxy WebSocket handling before changing Vaultwarden settings. The Proxy examples cover this deployment detail.

Backup

Back up the host storage mounted at /data; it contains the persistent data the container depends on. A practical routine includes:

  • A consistent copy of /data.
  • Protection for the backup destination and encryption keys.
  • A record of when each backup was taken.
  • At least one location separate from the running host.
  • A restore check before an outage occurs.

Back up before changing the image, Compose configuration, storage layout, or proxy. Keep configuration and secret-handling notes with recovery documentation, but do not mistake them for vault-data backups. Follow Backing up your vault for project guidance.

Update and rollback

Update only when /data is preserved, the latest backup is readable, and rollback is possible.

  1. Confirm the backup completed.
  2. Record the current Compose file and image reference.
  3. Pull or select the intended update.
  4. Recreate the service.
  5. Recheck status, logs, HTTPS, login, synchronization, and WebSockets.
  6. If it fails, restore the prior image reference and configuration, then verify the service and backup state.

Do not delete persistent storage while testing. Replace the container if needed, but keep the intended /data location attached. Record rollback steps clearly enough for another operator to follow.

Common failures

SymptomLikely causeCheck
Web vault works but clients failDOMAIN differs from the public URLCompare the setting with the browser URL
Data disappears after replacement/data is not durableInspect docker compose config
Synchronization is unreliableWebSocket forwarding is incompleteReview proxy settings and logs
Certificate warningTLS or DNS is wrongInspect the certificate and DNS path
New users can registerSignup change was not appliedConfirm the environment and restart
Mail does not arriveSMTP path or credentials are wrongReview mail settings and logs
Recovery is uncertainBackup was never restored in testingPerform a controlled restore check

Redact secrets before sharing logs. Use the official Proxy examples and backup guidance when the issue involves forwarding, persistence, or recovery.

Choose the next step

The deployment is ready when HTTPS works, /data persists, the first account signs in, public signup is closed, clients synchronize, and a restorable backup exists. Continue with Vaultwarden on OpenAlt, compare the official Bitwarden Server, or browse the password-manager directory.

Frequently Asked Questions

Is Vaultwarden official Bitwarden?

No. It is an unofficial, Bitwarden-compatible server project and is not associated with Bitwarden. See the official project README.

Is HTTPS required?

Treat HTTPS as required for a real user-facing deployment. Match the public URL to DOMAIN, issue the certificate before storing credentials, and enable WebSocket forwarding. See the Proxy examples.

Which folder must be backed up?

Back up the persistent storage mounted at /data. The Compose file helps rebuild the service but cannot replace a vault-data backup. Test restoration before relying on it. See Backing up your vault.

Can a small team use it?

Yes, if an operator owns HTTPS, persistence, signup control, backups, updates, and recovery testing. Close public signup after the first account and manage later access deliberately.

Should the admin interface be public?

Keep administrative access private unless it is intentionally protected through the proxy and access controls. Treat the admin token as a secret and never expose it in shared diagnostics.