
Vaultwarden is an unofficial Bitwarden server alternative written in Rust. It uses supports connections via Bitwarden clients and is less resource-heavy than the official Bitwarden service. This tutorial explains how to install Vaultwarden on Ubuntu 20.04 with Docker and docker-compose, and uses Caddy to secure the configuration.
Before you begin these steps, you should:
You should also create a DNS "A" record that points a hostname to the IP address of your server. Caddy requires a DNS name to install a TLS/SSL certificate.
Remove any older versions of Docker and the Docker engine.
Ensure that your version of snapd is up to date.
Install Docker using snap.
Create a directory called vaultwarden in your home directory and enter it.
Create and open a new docker-compose.yml file.
Add the following lines to the file.
Add the domain name or subdomain to the DOMAIN value under Caddy's environment variables.
Add an email address for TLS/SSL certificate registration to the EMAIL value under Caddy's environment variables.
Save and exit the text editor by using Control + X, then Y, followed by Enter.
Create and open a new Caddyfile.
Add the following lines to the file.
Save and exit the text editor by using Control + X, then Y, followed by Enter.
The Caddyfile configures Caddy to forward HTTPS requests from port 443 to Vaultwarden and adds additional headers to improve security, such as HTTP Strict Transport Security (HSTS) and Cross-Site Scripting (XSS) protection.
Run Vaultwarden by using docker-compose in detached mode. This may take a few seconds.
Check that Vaultwarden is running by using docker. The status should be Up.
To further improve security, additional configuration is available.
By default, anyone who accesses your Vaultwarden instance can create an account. This is useful when first creating your instance but may pose a security risk later.
After creating your account, you can disable registration by setting the SIGNUPS_ALLOWED environment variable to false in docker-compose.yml.
Vaultwarden also allows registered users to invite other new users to create accounts on the server. This feature is not a security risk as long as you trust your users. However, if you are the only user, you may want to disable this.
You can disable invitations by setting the INVITATIONS_ALLOWED environment variable to false in docker-compose.yml.
Bitwarden's password hints are usually sent by email. However, Vaultwarden accommodates personal deployments, so password hints are available on the password hint page. This feature exists, so you do not have to configure an email service.
If you want to disable password hints, set the SHOW_PASSWORD_HINT variable to false in docker-compose.yml.
If you changed any of the environment variables from the steps above, you must restart Vaultwarden. To do this, follow these steps:
Stop Vaultwarden by using docker-compose.
Rerun Vaultwarden by using docker-compose in detached mode.
Your new configuration should now be in effect.
You can use upstream Bitwarden clients by changing the server URL to your Vaultwarden instance.
You should now navigate to your Vaultwarden installation and create an account (if you haven't already).
After logging in, you can start adding your logins and passwords to your vault.
This completes the steps to install Vaultwarden and secure it using Caddy.
0 Comments
Be the first to comment and share your perspective with the community.