10 Reasons to Self-Host Vaultwarden on Docker (And How to Start)

Share
DifficultyBeginner
Time30 Minutes
PrerequisitesLinux Server (VPS or local), Domain Name (optional but recommended), Docker & Docker Compose
HardwareAny always-on machine like a Raspberry Pi 4, Beelink Mini PC, or Synology NAS

You are being watched. Not by a guy in a trench coat, but by corporations whose entire business model is harvesting your digital life. Every password you store in Chrome, every note in your phone’s default app, every bit of sensitive data sitting on a server you don’t control—it’s all just inventory for their advertising machines. You know this. That’s why you’re here.

Vaultwarden is the middle finger to that entire system. It’s an open-source, self-hosted password manager that is 100% compatible with Bitwarden’s apps and browser extensions. Think of it as your own private vault. You install it on a server you own, point your phone and laptop at it, and suddenly, your passwords are stored on your hardware, encrypted with your keys. No subscription. No data mining. No "we had a breach, please change all your passwords" emails. It’s a lightweight, efficient implementation of the Bitwarden server, written in Rust, which means it runs on a potato. A literal Raspberry Pi can handle this for a family of five.

Why does this exist? Because the official Bitwarden server is a bloated, resource-hungry monster designed for enterprise deployments. Vaultwarden is the community’s answer: a stripped-down, efficient version that gives you the same power without needing a 64GB RAM server. It’s the difference between driving a semi-truck to buy groceries and riding a bike. You want the bike.

Advertisement

By the end of this guide, you will have a fully functional password manager running on your own hardware. You’ll be able to log in from your phone, your work computer, and your browser, and you’ll never have to trust a third party with your credentials again. It takes about half an hour, and it’s a permanent win against the cloud dependency that’s strangling your privacy.

Prerequisites & Tools: What You Need Before You Start

Before we get our hands dirty, let’s line up the gear. You don’t need a supercomputer, but you do need a few specific things.

  1. A Linux Server: This can be a Virtual Private Server (VPS)—a rented virtual machine in the cloud—or a physical box sitting in your closet. I prefer physical hardware because you control the physical access, but a VPS is fine if you want remote access. If you don't have a server yet, a mini PC is the perfect low-power workhorse for this. It sips electricity, runs silent, and can handle Vaultwarden plus a dozen other self-hosted apps.

    If you want something even smaller and more power-efficient, a Raspberry Pi 4 works wonders. Just make sure you get the 8GB version so you have headroom.

  2. Docker and Docker Compose: We’ll use containers to run Vaultwarden. This sounds fancy, but it just means we’re packaging the software with everything it needs to run, so it doesn’t mess with your server’s operating system. It’s like a pre-packed lunchbox—everything is in the box, and you don’t have to hunt for ingredients.

  3. A Domain Name (Highly Recommended): Technically, you can access Vaultwarden via an IP address, but it’s a pain. You need a domain name to get a free SSL certificate (the padlock icon that encrypts traffic). I recommend getting one from a registrar that doesn’t upsell you on nonsense. Namecheap or Porkbun are solid, no-nonsense options.

    If you’re on a budget, a .xyz or .top domain costs around $3 AUD / $2 USD per year. That’s the price of a coffee, and it buys you permanent independence from Big Tech.

  4. A Bitwarden Client App: This is the app you’ll use to view your passwords. Vaultwarden is the server; the Bitwarden apps are the clients. Download the Bitwarden app on your phone or the browser extension on your desktop. It’s free and open-source. We’ll point it at your server later.

The Step-by-Step Guide: Getting Vaultwarden Live

Alright, let’s get to the meat. I’m assuming you have a fresh Linux server (Ubuntu 22.04 or later is what I’ll use for commands, but Debian works identically). Log in via SSH (Secure Shell—a secure way to control your server remotely from your terminal).

Step 1: Update Your Server

First, let’s make sure your server’s package list is up to date. Open your terminal and run:

sudo apt update && sudo apt upgrade -y

This tells your server to check for updated software lists and install any pending updates. The -y flag automatically answers "yes" to any prompts. You shouldn't have to babysit this.

Step 2: Install Docker and Docker Compose

We need Docker. The easiest way is to use the official convenience script. Run these commands one at a time:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

The first command downloads the installation script, and the second runs it. This installs Docker Engine, the Docker CLI (command line interface), and Docker Compose plugin. It takes a minute. Go make a coffee.

Step 3: Create a Directory for Vaultwarden

We need a home for the config files. Let’s create a dedicated folder:

sudo mkdir -p /opt/vaultwarden
cd /opt/vaultwarden

mkdir -p creates the directory and any parent directories if they don't exist. cd moves you into it. This keeps all the Vaultwarden files in one neat, tidy place.

Step 4: Create the Docker Compose File

This is the blueprint for our container. We’ll create a file called docker-compose.yml using the nano text editor:

sudo nano docker-compose.yml

Now, paste the following configuration into the file:

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.yourdomain.com"
      SIGNUPS_ALLOWED: "false"
      ADMIN_TOKEN: "YOUR_VERY_SECURE_RANDOM_TOKEN"
    volumes:
      - ./vw-data:/data
    ports:
      - "8080:80"

Let’s break this down so you’re not just blindly pasting:

  • image: This tells Docker which software to download. vaultwarden/server:latest is the official Vaultwarden image.
  • restart: unless-stopped: This is the "set and forget" rule. If your server reboots, Vaultwarden starts up automatically. You won’t have to manually restart it.
  • environment: These are settings passed to the app.
    • DOMAIN: This is your public URL. Replace vault.yourdomain.com with your actual subdomain (e.g., vault.mycoolname.xyz).
    • SIGNUPS_ALLOWED: Set this to "false" immediately. This prevents random internet strangers from creating accounts on your server. You’ll enable it temporarily later to create your account, then turn it off.
    • ADMIN_TOKEN: This is a password for the admin panel. Generate a strong random string. You can use a password generator on your phone or run openssl rand -base64 48 in your terminal. This is the master key to your admin settings, so make it long and unique.
  • volumes: This maps a folder on your server (./vw-data) to a folder inside the container (/data). This is how your data persists even if the container is updated or recreated.
  • ports: This maps port 8080 on your server to port 80 inside the container. The container runs a web server on port 80, but we expose it on 8080 to avoid conflicts.

Save the file: Press Ctrl+X, then Y, then Enter.

Step 5: Start the Container

Now, run the magic command:

sudo docker compose up -d

This downloads the Vaultwarden image and starts it in the background (-d means "detached"—it runs in the background). Wait for it to finish pulling. You’ll see a bunch of progress bars.

Step 6: Configure DNS and Reverse Proxy (The Tricky Part)

This is where most people get stuck. You need to point your domain at your server. Go to your domain registrar (Namecheap, Porkbun, etc.) and create an A record. This is a DNS (Domain Name System) entry that maps your subdomain to your server’s IP address. The DNS acts like the phonebook of the internet—it tells browsers where to find you.

  • Host: vault (this creates vault.yourdomain.com)
  • Value: Your server’s public IP address
  • TTL: Leave it default (or set to 300 seconds for faster propagation)

Now, you need to set up a reverse proxy. This is a piece of software that sits in front of Vaultwarden and handles HTTPS (the secure, encrypted version of HTTP). It’s what gets you that padlock icon. You have two options: Nginx Proxy Manager (easy GUI) or Caddy (very simple config). I prefer Caddy because it automatically handles SSL certificates with zero configuration.

Install Caddy:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Then, edit the Caddyfile:

sudo nano /etc/caddy/Caddyfile

Add this:

vault.yourdomain.com {
    reverse_proxy localhost:8080
}

Save and exit, then restart Caddy:

sudo systemctl restart caddy

Caddy automatically fetches a free SSL certificate from Let’s Encrypt and handles all the encryption. You now have a secure endpoint.

Step 7: Create Your Account

Now, go back to your docker-compose.yml file and temporarily set SIGNUPS_ALLOWED to "true". Then run:

sudo docker compose up -d

This recreates the container with the new setting. Now, navigate to https://vault.yourdomain.com in your browser. You should see the Bitwarden login page. Click "Create Account" and make your master password.

Warning: This master password is the key to your kingdom. If you forget it, there is no recovery. Write it down and store it in a physical safe. Do not lose this.

Once you’ve created your account, immediately go back to the docker-compose.yml file and set SIGNUPS_ALLOWED back to "false". Run sudo docker compose up -d again to apply.

Post-Install Setup: Making It Yours

Now that you’re logged in, you need to connect your apps. On your phone, download the Bitwarden app. When it asks for the server URL, tap the gear icon and enter https://vault.yourdomain.com. Log in with your master password.

You also have an Admin Panel at https://vault.yourdomain.com/admin. Log in with the ADMIN_TOKEN you set earlier. Here, you can manage users, disable new signups, and tweak settings. You can also enable two-factor authentication (2FA) for your account—do this. It adds a second layer of security, like a deadbolt on your vault door.

Common Pitfalls & Troubleshooting

You will hit a wall. Everyone does. Here are the two most common ones:

Pitfall 1: The "Connection Not Secure" Error / SSL Certificate Issues

If you visit your domain and get a warning, it’s almost always because your DNS hasn’t propagated yet. DNS changes can take up to 48 hours, but usually, it’s under 10 minutes. Check your A record. Did you type the IP address correctly? If you’re using Caddy and it fails to get a certificate, check your Caddy logs:

sudo journalctl -u caddy --no-pager | tail -20

If you see an error about "no such host," your DNS is wrong. If you see "timeout," your firewall is blocking port 80 and 443. Open those ports:

sudo ufw allow 80,443/tcp

Pitfall 2: The "Vault is Locked" / "Cannot Reach Server" Error in the App

This happens when you try to log in from your phone, but the app can’t reach your server. First, make sure you’re on the same network (or that your VPS is publicly accessible). Second, check that you entered the URL correctly in the app settings—it must be https://vault.yourdomain.com, not http:// and not the IP address. If you’re using a local server on your home network, you’ll need to set up port forwarding on your router (forward ports 80 and 443 to your server’s internal IP). This is a router-specific setting, so Google your router model + "port forwarding" if you get stuck.

Conclusion: You Own Your Data Now

Congratulations. You just took a massive piece of your digital life back from the corporate cloud. You are no longer a product. Your passwords are now stored on hardware you control, encrypted with keys only you possess. This is what "hosting it yourself" is all about—not being a sysadmin for the sake of it, but reclaiming your autonomy.

The setup takes half an hour. The payoff is permanent. You’ll never pay a subscription fee for a password manager again, and you’ll never have to worry about a data breach at a third-party company exposing your credentials. You did the work. Now go enjoy the peace of mind. And if you ever want to ditch Google entirely, remember that privacy-respecting email alternatives like Tuta or ProtonMail are waiting for you. But that’s a battle for another day. Today, you won.


Glossary & Resources

Hardware Suggestions

If you are building a setup for this project, here are some options that work well:

Terms Used in this Guide

  • Server: A computer or program that provides services or data to other computers (clients) over a network.
  • Docker Compose: A tool that lets you define and run multi-container applications using a simple configuration file.
  • open-source: Software whose code is publicly available for anyone to view, modify, and share.
  • self-hosted: A software setup where you run and manage the application on your own hardware instead of using a service provided by a company.
  • encrypted: Scrambled into a secret code so that only someone with the correct key can read it.

Join the Self-Hosting Revolution

Don't let the cloud giants control your data. Get my latest tutorials, hardware reviews, and deployment guides delivered straight to your inbox.

Subscribe for Free

Read more