DocsSelf-hostDeploy & ConfigureDeploy with Docker

Lite Deployment

tip

Bitwarden lite is intended for personal use and home-labs, not for use in business contexts. Businesses should use one of the standard deployment options.

This article will walk you through installing and launching Bitwarden lite. Use this deployment method to:

  • Simplify configuration and optimize resource usage (CPU, memory) by deploying Bitwarden with a single Docker image.

  • Utilize different database solutions such as MSSQL, PostgreSQL, SQLite, and MySQL/MariaDB. Only lite deployments can currently leverage these databases, standard deployments require MSSQL.

  • Run on ARM architecture for alternative systems such as Raspberry Pi and NAS servers.

System requirements

Bitwarden lite requires:

  • RAM: At least 200 MB

  • Storage: At least 1GB

  • Docker Engine: Version 26+

Setup

Before running a Bitwarden lite server, install Docker, setup your settings.env file, and decide on your database configuration:

Install Docker

Bitwarden lite will run on your machine using a Docker container. Lite can be run with any Docker edition or plan, but you must install Docker on your machine before proceeding with installation. Refer to the following Docker documentation for help:

Required environment variables

Environment variables can be specified by creating a settings.env file, which you can find an example of in our GitHub repository, or by using the --env flag if you're using the docker run method. At a minimum, set values for the variables that fall under the # Required Settings # section of the example .env file:

tip

More optional environment variables are available than those listed in this table.

Database examples

Unlike standard Bitwarden deployments, lite does not come out-of-the-box with a database. You can use an existing database, or create a new one. Which # Required Settings # you'll be required to include in your settings.env file or --env flags will depend on which supported database provider you're using:

The following variables are required for a MySQL or MariaDB database:

Bash
# Database BW_DB_PROVIDER=mysql BW_DB_SERVER=db BW_DB_DATABASE=bitwarden_vault BW_DB_USERNAME=bitwarden BW_DB_PASSWORD=super_strong_password

Run the server

The lite deployment can be run using the docker run command or using Docker Compose. In either case, make sure that you've set your environment variables and made your database available before proceeding.

The lite deployment can be run with the docker run command, as in the following example:

Bash
docker run -d --name bitwarden -v /$(pwd)/bwdata/:/etc/bitwarden -p 80:8080 --env-file settings.env ghcr.io/bitwarden/lite

Running the server with the docker run command has several required options, including:

Once you run the command, verify that the container is running and healthy with:

Bash
docker ps

Congratulations! Bitwarden lite is now up and running at https://your.domain.com. Visit the web vault in your browser to confirm that it's working. You may now register a new account and log in.

Update or restart the server

It's important to keep your Bitwarden lite server up to date. Like running the server, you can update it using either docker run commands or Docker Compose:

tip

If you're restarting instead of updating the server, for example after making environment variable changes, skip the step that requires you to pull the most recent Bitwarden lite image.

To update the server:

  1. Stop the running Docker container:

    Bash
    docker stop bitwarden
  2. Remove the Docker container:

    Bash
    docker rm bitwarden
  3. Pull the most recent Bitwarden lite image:

    Bash
    docker pull ghcr.io/bitwarden/lite
  4. Restart the server:

    Bash
    docker run -d --name bitwarden -v /$(pwd)/bwdata/:/etc/bitwarden -p 80:8080 --env-file settings.env ghcr.io/bitwarden/lite

Optional environment variables

Bitwarden lite works, by default, with some available services deactivated. These services, and many other server characteristics, can optionally be activated and customized with your settings.env file or --env flags:

warning

Whenever you change an environment variable, you will need to restart your server in order for changes to take effect.

Services

Additional services can be activated or deactivated using the following variables:

Certificates

Use these variables to change certificate settings:

note

If you are using an existing SSL certificate, you will have to enable the appropriate SSL options in settings.env. SSL files must be stored in /etc/bitwarden, which can be referenced in the the docker-compose.yml file. These files must match the names configured in settings.env.

The default behavior is to generate a self-signed certificate if SSL is enabled and no existing certificate files are in the expected location (/etc/bitwarden).

SMTP

Use these variables to setup or change an SMTP provider for your server:

Ports

Use these variables to configure the ports used for traffic:

Yubico API

Use these variables to connect with Yubico Web Services:

Miscellaneous

Use these variables to configure other characteristics of your Bitwarden lite server:

Troubleshooting

Memory usage

By default, the Bitwarden container will consume memory that is available to it, often being more than the minimum needed to run. For memory conscious environments, you can use docker -m or --memory= to limit the Bitwarden container's memory usage.

To control memory usage with Docker Compose, use the mem_limit key:

Bash
services: bitwarden: env_file: - settings.env image: ghcr.io/bitwarden/lite restart: always mem_limit: 200m