Skip to content

Set Up Bitwarden on a Linux Server – Secure Your Password Management

Discover how to securely self-host Bitwarden to manage passwords with end-to-end encryption and strong credentials → Learn more now

12 November 20264 min read73 Views0 helpful

Introduction

Bitwarden is an open-source password manager for passwords and passkeys that uses zero-knowledge and end-to-end encryption to protect your data. You can use it as a cloud service or self-host it—with features for generating, storing, and auto-filling strong credentials.

Want to self-host this service? We guide you step-by-step through the setup and configuration and show you everything you need to consider.

Requirements

Before installing Bitwarden, make sure your hosting environment meets the following requirements to ensure a smooth installation and optimal performance.

HardwareMinimumZAP-Hosting Recommendation
CPU1 vCPU core4 vCPU cores
RAM2 GB4 GB
Disk Space12 GB25 GB

The software requires all necessary dependencies to be installed and to run on a supported operating system. Verify that your server meets the following before starting the installation:

Dependencies: Docker (Engine 26+ and Compose)

Operating System: Latest version of Ubuntu/Debian with Docker 26+ support

Ensure all dependencies are installed and the correct OS version is used to avoid compatibility issues during Bitwarden installation.

Preparation

Before setting up Bitwarden, you need to prepare your system. This includes updating your operating system and installing all required dependencies. This preparation ensures a stable environment and helps prevent issues during or after installation.

Update the System

To run your system with the latest software and security updates, first perform an update by running:

Code
sudo apt update && sudo apt upgrade -y

This ensures your system has the latest security patches and software versions before proceeding.

Install Dependencies

After the update completes, proceed with installing dependencies. Bitwarden runs via multiple Docker containers on your system. Docker must be installed first. Run the following commands:

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

For detailed instructions on installing and using Docker, see our Docker guide.

Create User & Directory

It is recommended to configure your Linux server with a dedicated bitwarden service account from which Bitwarden is installed and operated. This keeps your Bitwarden instance isolated from other applications on your server.

Create the Bitwarden user and set a strong, unique password for this account.

Code
sudo adduser bitwarden
sudo passwd bitwarden

Create the Docker group if it does not exist and add the Bitwarden user to this group:

Code
sudo groupadd docker
sudo usermod -aG docker bitwarden

Create the working directory, set permissions, and assign ownership to bitwarden:

Code
sudo mkdir /opt/bitwarden
sudo chmod -R 700 /opt/bitwarden
sudo chown -R bitwarden:bitwarden /opt/bitwarden

Configure Domain

By default, Bitwarden runs on the host over ports 80 (HTTP) and 443 (HTTPS). Set up a domain with DNS records pointing to the host, e.g., server.example.com, especially if you provide the service over the internet. Avoid using "bitwarden" in the hostname to not unnecessarily reveal the server’s role or software.

Installation

Once all requirements are met and preparations complete, you can start installing Bitwarden.

Download the Bitwarden installation script to your server and execute it. A directory ./bwdata will be created relative to the location of bitwarden.sh.

Code
curl -Lso bitwarden.sh "https://func.bitwarden.com/api/dl/?app=self-host&platform=linux" && chmod 700 bitwarden.sh
./bitwarden.sh install

During the installer, first enter the domain name of your Bitwarden instance, typically the configured DNS entry. Then choose whether Let’s Encrypt should generate a free, trusted SSL certificate. If yes, provide an email for expiration notifications. If no, you will be asked about the certificate.

Enter your installation ID and key obtained from Bitwarden. Then select the US or EU region, which is only relevant if you connect a self-hosted instance with a paid subscription.

If you don’t use Let’s Encrypt, you can use an existing certificate by placing the files in ./bwdata/ssl/your.domain and indicating if it’s trusted. Alternatively, you can generate a self-signed certificate, which is recommended only for testing. If you don’t use a certificate, you must place an HTTPS proxy in front of the installation; otherwise, Bitwarden apps won’t work.

Configuration

After installation, complete the basic configuration via two files. First, edit the environment file at ./bwdata/env/global.override.env. Enter your SMTP server details there, including host, port, SSL, username, and password, so Bitwarden can send verification and organization invitation emails. If you need access to the system admin portal, add an admin email to adminSettings__admins.

Code
...
globalSettings__mail__smtp__host=<placeholder>
globalSettings__mail__smtp__port=<placeholder>
globalSettings__mail__smtp__ssl=<placeholder>
globalSettings__mail__smtp__username=<placeholder>
globalSettings__mail__smtp__password=<placeholder>
...
adminSettings__admins=
...

Test the SMTP configuration with ./bitwarden.sh checksmtp. A correct setup reports success; otherwise, you’ll get hints about missing OpenSSL or incorrect values. Apply changes with ./bitwarden.sh restart.

Next, check the installation parameters in ./bwdata/config.yml. This file controls generated assets and must be adjusted for special environments, e.g., if you work behind a proxy or use alternative ports. Apply changes with ./bitwarden.sh rebuild.

Finally, start the instance with ./bitwarden.sh start. The first start may take some time while Docker pulls images. Use docker ps to check if all containers are healthy. Then open the web vault under your configured domain and register an account if needed. Email verification only works with correctly configured SMTP variables.

Completion and Further Resources

Congratulations! You have successfully installed and configured Bitwarden on your VPS/Dedicated Server. We also recommend checking out the following resources to help with server configuration:

Have specific questions not answered here? Our team is available daily for further questions or support—just reach out to us! 🙂

FAQ

Frequently asked questions

Bitwarden is an open-source password manager for passwords and passkeys that uses zero-knowledge and end-to-end encryption. You can use it as a cloud service or self-host it.
Bitwarden requires Docker (Engine 26+ and Compose) and runs on the latest Ubuntu/Debian version with Docker 26+ support.
Minimum requirements are 1 vCPU core, 2 GB RAM, and 12 GB disk space. ZAP-Hosting recommends 4 vCPU cores, 4 GB RAM, and 25 GB disk space.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.