Configuration

Ports

The container will expose port 5701. You can map this to any port you want on your host machine.

Internally the AdminConsole and Api will both communicate internally using ports 5000 and 5001. Network traffic will by default not leave the container.

Volumes

You will want to mount persistent storage for your running Docker container. It is very important that you map the container's path /etc/bitwarden_passwordless. Then you can be confident your settings and Sqlite database, assuming you don't use any other databases, persist between updates, migrations, etc.

WARNING

Failure to mount persistent storage, will:

  • Result in loss of configuration if you're dependent on /etc/bitwarden_passwordless/config.json.
  • Result in loss of data only when using Sqlite.
$ docker run -d \
  --name passwordless \
  --mount source=/your/persistent/storage,target=/etc/bitwarden_passwordless \
  bitwarden/passwordless-self-host:stable

Database

Sqlite

By default, the container will use Sqlite if nothing else is specified. The data will be stored in the following locations:

  • /etc/bitwarden_passwordless/api.db
  • /etc/bitwarden_passwordless/admin.db

Microsoft SQL Server

KeyDefaultRequiredDescription
BWP_DB_PROVIDERY[sqlserver/mssql] Both values will allow you to use Microsoft SQL Server.
BWP_DB_SERVERYHostname, for example 'localhost' or 'db.example.com'.
BWP_DB_PORT1433N[0-65536]
BWP_DB_DATABASE_APIApiNName for the 'Api' application's database on the Microsoft SQL Server instance.
BWP_DB_DATABASE_ADMINAdminNName for the 'Admin Console' application's database on the Microsoft SQL Server instance.
BWP_DB_USERNAMEsaN
BWP_DB_PASSWORDY

Environment variables

KeyDefaultRequiredDescription
BWP_ENABLE_SSLfalseN[true/false] See warning below.
BWP_PORT5701Y[0-65536] This will determine the port your self-hosted instance will be accessible from.
BWP_DOMAINlocalhostN[example.com] This will be the domain your self-hosted instance will be accessible from. It is important it matches for everything to work correctly.
BWP_DB_PROVIDERN[mssql/sqlserver/] Defaults to using Sqlite if not set
BWP_DB_SERVERNFor any non-file hosted database, enter its domain name. Required for Microsoft SQL Server.
BWP_DB_PORTN[0-65536] For any non-file hosted database, enter the port. Required for Microsoft SQL Server.
BWP_DB_DATABASE_APINDatabase name for the API. Required for Microsoft SQL Server.
BWP_DB_DATABASE_ADMINNDatabase name for the Admin Console. Required for Microsoft SQL Server.
BWP_DB_USERNAMENUsername for the user connecting to the database. Required for Microsoft SQL Server.
BWP_DB_PASSWORDNPassword for the user connecting to the database. Required for Microsoft SQL Server.

WARNING

Setting SSL with BWP_ENABLE_SSL is required in insecure contextsopen in new window. Running the container locally on 'localhost' is considered a secure context.

Read the 'WebAuthn' specification here: See specificationopen in new window.

E-mail

Email is used by Passwordless Admin Console to notify administrators of changes to their organization. This is specifically useful for verifying administrators when first signing up.

By default, all e-mail communication is written to a file for each application.

  • /app/Admin/mail.md
  • /app/Api/mail.md

When using the default configuration, the following commands will output the contents of each file.

For Admin Console:

docker exec -it {name-of-container} cat /app/AdminConsole/mail.md

For Api:

docker exec -it {name-of-container} cat /app/Api/mail.md

If you provide a directory for the application configuration to be stored in on your machine, the mail.md file will be located there.

It's recommended you configure the SMTP parameters below:

KeyDefaultRequiredDescription
BWP_SMTP_FROMYUse your sender e-mail.
BWP_SMTP_USERNAMEY
BWP_SMTP_PASSWORDY
BWP_SMTP_HOSTYHostname
BWP_SMTP_PORTY[0-65535]
BWP_SMTP_STARTTLSfalseN[true/false]
BWP_SMTP_SSLfalseN[true/false]
BWP_SMTP_TRUSTSERVERfalseN[true/false] Allows you to skip certificate validation. Not recommended for production.

WARNING

To verify e-mailing is working correctly:

  • Create an admin with a new organization.
  • Invite an admin to an existing organization.

SendGrid example with SSL

For verifying e-mailing is working correctly, you can use health-checks, read more here.


* BWP_SMTP_FROM: [email protected]
* BWP_SMTP_USERNAME: apikey
* BWP_SMTP_PASSWORD: <your-api-key>
* BWP_SMTP_HOST: smtp.sendgrid.net
* BWP_SMTP_PORT: 465
* BWP_SMTP_SSL: true
* BWP_SMTP_TRUSTSERVER: true (for local testing)

## config.json

:::warning
Requirements:
- Persistent storage, see 'Volumes'.
:::

`/etc/bitwarden_passwordless/config.json` is only generated when you have not specified the following environment variables:


If you mount `/etc/bitwarden_passwordless` to your host. You can specify a `config.json`.

If the following keys do not exist, they will be generated automatically:
- Passwordless::ApiKey
- Passwordless::ApiSecret
- PasswordlessManagement::ManagementKey
- SALT_KEY

It is recommended that you have them generated automatically, the first time you run `bitwarden/passwordless-self-host`.