Back to blog
Blog

Host Vaultwarden on a VPS With HTTPS and Backups

Host Vaultwarden on a VPS with HTTPS, safe updates, and encrypted backups for families and small teams.

By Anurag Singh
Updated on Dec 05, 2026
Category: Blog
Share article
Host Vaultwarden on a VPS With HTTPS and Backups

Password managers usually fail in two places. You don’t trust where the vault lives. Or you don’t control the backups. If you’re ready to host Vaultwarden on a VPS, you can run a Bitwarden-compatible vault under your own domain, enforce real HTTPS, and back it up on your terms.

This is written for operators who already run websites, apps, and servers. The goal is simple: explain what Vaultwarden is, where it fits, and how to deploy it cleanly on a VPS.

You’ll use Docker Compose, a reverse proxy, Let’s Encrypt, encrypted backups, and predictable upgrades.

What Vaultwarden solves (and who should run it)

Vaultwarden is a community-built server that implements the Bitwarden client protocol. You host the server yourself. You keep using the Bitwarden desktop apps, mobile apps, and browser extensions you already know.

It’s a good match if you’re:

  • A family that wants a shared vault without handing it to a third party.
  • A small team that needs basic org features (collections, sharing) and wants admin control.
  • A server operator who already maintains a VPS and wants stable costs plus backups you can verify.

It’s a weaker fit if you need enterprise SSO, formal compliance attestations, or a helpdesk workflow for provisioning and offboarding.

In those cases, hosted Bitwarden Enterprise or 1Password Business may still be the better tool.

Open-source spotlight: Vaultwarden licensing and what you actually get

Vaultwarden is open source (AGPLv3). If you want auditable server-side code and redistribution under a copyleft license, that matters.

Bitwarden’s official server uses a different licensing model and packaging approach. Vaultwarden is the lightweight option many self-hosters pick because it runs comfortably on small VPS plans.

In daily use, you’ll care about:

  • Compatibility with official Bitwarden clients (desktop, mobile, browser).
  • Client-side end-to-end encryption, consistent with the Bitwarden ecosystem.
  • Organizations, collections, attachments, and TOTP fields for typical self-host setups.
  • Simple Docker operation—as long as you keep config and volumes organized.

Two operational realities before you commit:

  • Backups are on you. You’re running a database. Treat it like one.
  • Email delivery isn’t optional for a good UX. Invites, verification, and security alerts need a reliable SMTP relay. Without it, users will assume the service is unreliable.

Vaultwarden vs 1Password and hosted Bitwarden (a realistic comparison)

Self-hosting isn’t automatically “better.” It’s a trade. You take on responsibility in exchange for control.

OptionWhat you gainWhat you give up
1Password (hosted)Polished admin, support, strong managed experienceLess infrastructure control, pricing scales quickly with seats
Bitwarden (hosted)Good UX, minimal ops, official serviceVault resides off your infrastructure, backups/auditing are less direct
Vaultwarden (self-hosted)Your domain, your TLS, your retention policy, predictable VPS costsYou own patching, monitoring, backups, SMTP, and incident response

If you already operate a production site or app, Vaultwarden fits the same pattern. Put HTTPS at the edge. Expose minimal ports. Run nightly backups. Update during planned windows.

Plan the VPS: sizing, OS, and baseline hardening

Vaultwarden itself is lightweight. What usually matters more is database I/O (SQLite vs PostgreSQL), attachment storage, and TLS termination if the VPS hosts other services.

  • Small family (2–6 users): 1 vCPU, 1 GB RAM, 25+ GB SSD/NVMe is usually enough.
  • Small team (10–30 users): 2 vCPU, 2 GB RAM, 40+ GB SSD/NVMe.
  • Attachments-heavy use: size disk for growth; vault databases stay small, files don’t.

Use an OS you already know how to maintain. Ubuntu 24.04 LTS and Debian 12 are still common choices in 2026. Security updates are predictable, and Docker support is mature.

On a new VPS, do baseline hardening first. Use SSH keys. Disable password login. Set a firewall that exposes only 80/443 publicly.

If you want a checklist, Set up SSH keys and disable password login on a VPS covers the essentials.

A standard Linux plan is plenty for Vaultwarden. If you want the provider to handle OS patching, Docker upkeep, and basic monitoring, managed VPS hosting is the lowest-friction way to run something as sensitive as a password manager.

Host Vaultwarden on a VPS with Docker Compose (clean layout)

A sane directory layout pays off later. It matters even more once you add backups and an upgrade routine.

This structure is easy to live with:

  • /opt/vaultwarden/compose.yml
  • /opt/vaultwarden/.env
  • /opt/vaultwarden/data/ (persistent volume)

Install Docker Engine and the Compose plugin using your distro’s recommended method. Then create the project directory:

sudo mkdir -p /opt/vaultwarden/data
sudo chown -R root:root /opt/vaultwarden
cd /opt/vaultwarden

A minimal compose.yml can be as simple as:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      - TZ=UTC
      - DOMAIN=https://vault.example.com
      - SIGNUPS_ALLOWED=false
      - INVITATIONS_ALLOWED=true
      - ROCKET_PORT=8080
    volumes:
      - ./data:/data
    networks:
      - web

networks:
  web:
    external: true

Two details prevent common mistakes:

  • Set DOMAIN to your real HTTPS URL. Clients rely on it for validation. The server also uses it to build links.
  • Start with SIGNUPS_ALLOWED=false. An open signup page is an easy way to invite abuse. Invite users intentionally.

This example uses a shared external Docker network (web) for your reverse proxy. Create it once:

docker network create web

Then bring Vaultwarden up:

docker compose up -d

On a VPS that runs multiple apps, Compose plus a single reverse proxy keeps port mappings clean. It also reduces accidental exposure.

Reverse proxy + HTTPS with Let’s Encrypt (two good options)

You need TLS immediately. Vaultwarden carries authentication tokens and vault metadata.

Vault contents are encrypted client-side, but HTTPS still protects sessions and prevents traffic tampering.

Two operator-friendly approaches:

  • Caddy: automatic HTTPS with small, readable configs.
  • Traefik: a strong fit if you already route services via labels.

If your stack already standardizes on Traefik, stick with it. If you want fewer moving parts, Caddy is hard to beat.

Option A: Caddy reverse proxy (minimal config)

Run Caddy as the edge proxy. Route to the Vaultwarden container over the Docker network.

If you want a complete pattern for Caddy + HTTPS on a VPS, it’s similar to the setup used in Jellyfin media server on a VPS with Caddy HTTPS.

A straightforward Caddyfile looks like:

vault.example.com {
  encode zstd gzip

  header {
    Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    X-Content-Type-Options "nosniff"
    X-Frame-Options "DENY"
    Referrer-Policy "no-referrer"
  }

  reverse_proxy vaultwarden:8080
}

Caddy will obtain and renew Let’s Encrypt certificates automatically. DNS must point to your VPS, and ports 80/443 must be reachable.

Option B: Traefik labels (if you already run it)

If Traefik is already in place, label the Vaultwarden container. Traefik will handle routing and certificates.

For a working template, see Traefik with Docker Compose for HTTPS on a VPS and adapt the router/service names.

Whichever proxy you choose, keep Vaultwarden itself off public ports. Only the reverse proxy should bind to 80/443.

Email, DNS, and the “it works on my phone” test

Vaultwarden will run without SMTP, but the gaps show up fast. Invites, verification, and security alerts won’t arrive.

Use a real SMTP relay with authenticated sending. Publish SPF/DKIM/DMARC for your domain.

If you already have an email pattern for apps, reuse it. These two posts cover common failure modes:

Once DNS and SMTP are in place, do a quick acceptance pass:

  • Log in from a browser extension and a mobile device.
  • Invite a second user (even if it’s your own alternate email).
  • Create one shared item and confirm it syncs across devices.

Backups that you can restore: encrypted, scheduled, and offsite

Vaultwarden data is usually a small database plus attachments. Your backups should be encrypted and offsite.

A copy on the same VPS isn’t a backup. It’s a slightly delayed failure.

You have two sensible strategies:

  • File-level backups of /opt/vaultwarden/data (simple, works well with SQLite on smaller instances).
  • Database-aware backups if you run PostgreSQL externally or inside the same Compose stack (better once usage and concurrency grow).

For most families and small teams, encrypted file-level backups with retention are enough. Schedule them during low usage. Then prove you can restore.

A proven approach is Restic. This pattern is close to drop-in: Docker Compose backups with Restic on a VPS. Point it at /opt/vaultwarden (or at least data) and push to an S3-compatible bucket or another offsite target.

At minimum, back up:

  • /opt/vaultwarden/data/
  • Your reverse proxy config (Caddyfile/Traefik dynamic config)
  • Any environment files that contain operational settings (store secrets carefully)

Don’t skip restore drills. Once a month, restore onto a temporary VM or throwaway Docker host. Confirm you can log in.

Backups aren’t the goal. Restores are.

Safe upgrades without surprises (what to pin, what to watch)

Vaultwarden upgrades are usually quiet, but you still need a routine. For any internet-facing service, follow a pattern: back up first, update second, verify third.

A conservative upgrade loop looks like this:

  1. Take an on-demand backup (in addition to nightly).
  2. Pull the new image and recreate containers.
  3. Watch logs for migrations or warnings.
  4. Log in from at least two client types (mobile + browser extension).
cd /opt/vaultwarden
docker compose pull
docker compose up -d
docker logs --since=10m vaultwarden

To reduce surprises, pin to a specific image tag after you’ve validated it in staging. “Latest” is convenient, but it turns every deploy into a blind bet.

If you automate updates, do it with intention. Auto-update tools can be fine for low-risk services, but password managers deserve maintenance windows.

If you go this route, read Docker Compose auto-updates with Watchtower and scope it to explicit containers.

Operational hygiene: ports, headers, and brute-force protection

A Vaultwarden VPS should look boring from the outside. Only 80/443 should be open. Lock everything else down to your admin IP or a VPN.

  • Firewall: allow 22 (restricted), 80, 443. Block everything else inbound.
  • Admin panel exposure: only enable it if you need it, and protect it tightly.
  • Fail2ban/CrowdSec: block repeated auth attempts at the edge.

If the VPS runs other public services, add an automated bouncer. That way, one noisy bot doesn’t become your problem.

The flow in Install CrowdSec on Ubuntu VPS to block brute force is a practical starting point.

Also watch disk usage. Attachments and logs creep up quietly. Then you hit a full disk and the service falls over.

If that happens, this diagnostic workflow saves time: Disk full on VPS: find large files and free space safely.

Where this fits in a real hosting stack

Most people don’t run Vaultwarden in isolation. It often shares a VPS with WordPress, a small API, a client portal, or internal tools.

That’s where capacity planning stops being theoretical.

If you consolidate services, three pressure points show up fast:

  • RAM contention: databases and PHP workers spike unpredictably; don’t cram everything into 1 GB.
  • Storage performance: slow disks drag down backups and database writes.
  • Blast radius: one compromised CMS shouldn’t put your password vault at risk.

For a family or tiny team, one well-secured VPS can work fine.

For agencies or multi-site operators, it’s often cleaner to isolate Vaultwarden on its own small VPS. Keep the “messier” app stack elsewhere.

If you’re starting from scratch, HostMyCode VPS plans are a good fit for Vaultwarden: predictable resources, full root access, and enough flexibility to run Docker plus a reverse proxy without wrestling a control panel.

Summary: self-hosting done responsibly

Vaultwarden is the kind of self-hosted service that keeps paying for itself over time. Put it behind HTTPS. Keep signups closed. Run reliable SMTP. Treat backups like a core feature.

Do those four things and day-to-day operation stays calm.

If you want a clean starting point, use a small Linux instance and scale only when usage demands it.

If you’d rather not spend your weekends patching Docker and reviewing firewall rules, managed VPS hosting is the “keep it boring” option for a password vault.

Vaultwarden is small enough for a modest VPS, but sensitive enough to justify infrastructure you trust. If you want predictable performance and full control, run it on a HostMyCode VPS. If you’d rather offload patching and baseline hardening, choose managed VPS hosting and keep your time focused on users, not upkeep.

FAQ

Can Vaultwarden replace 1Password for a family?

Often, yes—especially if your main needs are shared logins, secure notes, and syncing across devices. You trade a managed experience for control over hosting, backups, and your domain.

Should I use SQLite or PostgreSQL for Vaultwarden?

SQLite is fine for many small deployments and keeps the stack simple. If you expect higher concurrency, heavier usage, or want stricter database operational tooling, PostgreSQL is a better long-term choice.

Do I really need HTTPS if the vault is end-to-end encrypted?

Yes. HTTPS protects logins, sessions, API tokens, and prevents traffic tampering. Put Vaultwarden behind a reverse proxy with Let’s Encrypt on day one.

What’s the minimum backup plan that’s still responsible?

Nightly encrypted backups of the persistent data directory to an offsite target, plus a monthly restore test. If you can’t restore, you don’t have backups.

How do I update Vaultwarden safely?

Back up first, then docker compose pull and docker compose up -d. Check logs and verify login from at least two client types before calling it done.

Host Vaultwarden on a VPS With HTTPS and Backups | HostMyCode