Connect to an External MSSQL Database
By default, self-hosted instances of Bitwarden will use a Microsoft SQL Server (MSSQL) database created as a normal part of installation setup, however you configure Bitwarden to use an external MSSQL database.
Currently, self-hosted installations of Bitwarden support only MSSQL databases. Stay tuned for future updates on this topic.
To setup your self-hosted instance with an external database:
Create a new MSSQL database named
You must use
vaultas your database name. A different database name will cause migration to fail.
(Recommended) Create a dedicated DBO for your
As an administrator of your Bitwarden server, open the
global.override.envfile in an editor:
globalSettings__sqlServer__connectionString=value for the following information:
"Data Source=tcp:mssql,1443";with your MSSQL server name, for example
User ID=sa;with your DBO User ID.
Password=<default_pw>;with your DBO password.
Save your changes to
Start Bitwarden (
Once the above steps are complete, you can test the connection by creating a new user through the web vault and querying the external
vault database for creation of the new user.
Validate a server certificate
If you need Bitwarden to validate your MSSQL database server's certificate, mount the certificate into your self-hosted Bitwarden server's containers. To do this:
Copy your root CA certificate into
./bitwarden.sh restartcommand to apply the certificate to your containers and restart your server.