Skip to content
Bitwarden Logo

config

The config command specifies server settings for the Secrets Manager CLI to use. A primary use of bws config is to connect the CLI to a self-hosted Bitwarden server.

Available settings include server-base, server-api, and server-identity, for example:

Terminal window
bws config server-base https://my_hosted_server.com

When done this way, your specified server values will be saved to a default profile in a ~/.bws/config file. You can use subsequent options to create alternate profiles and config files:

config —profile

Use the --profile option with the config command to save specified server values to alternate profiles, for example:

Terminal window
bws config server-base http://other_hosted_server.com --profile dev

Once created, you can use that profile with other commands to route requests to the specified server, for example:

Terminal window
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --profile dev

config —config-file

Use the --config-file option with the config command to save specified server values to alternate config files, for example to save values to a default profile in a new config file:

Terminal window
bws config server-base http://third_hosted_server.com --config-file ~/.bws/alt_config

You can chain --config-file with --profile to save values to alternate profiles in alternate config files, for example:

Terminal window
bws config server-base http://third_hosted_server.com --config-file ~/.bws/alt_config --profile alt_dev

Once created, you can use that profile with other commands to route requests to the specified server, for example:

Terminal window
bws secret get 2863ced6-eba1-48b4-b5c0-afa30104877a --config-file ~/.bws/alt_config --profile alt_dev

Config Docker

Pass config file into Docker container with run command:

Terminal window
docker run -it -v /PATH/TO/YOUR/CONFIGFILE:/home/app/.bws/config -e BWS_ACCESS_TOKEN=<ACCESS_TOKEN_VALUE> bitwarden/bws secret list