### Run Bitwarden Installer Source: https://bitwarden.com/help/install-on-premise-windows.md Execute the Bitwarden installation script with the '-install' parameter to begin the setup process. ```powershell .\bitwarden.ps1 -install ``` -------------------------------- ### Start Bitwarden Instance Source: https://bitwarden.com/help/install-on-premise-windows.md Start all Bitwarden containers after completing the initial setup or configuration changes. The first start may take time to download Docker images. ```powershell .\bitwarden.ps1 -start ``` -------------------------------- ### Configure Docker Desktop to Start on Boot Source: https://bitwarden.com/help/install-and-deploy-offline-windows.md This command specifies the path to the Docker Desktop executable for a scheduled task. Ensure the path is correct for your installation. ```powershell "C:\Program Files\Docker\Docker\frontend\Docker Desktop.exe" ``` -------------------------------- ### Get Help for Specific Command Source: https://bitwarden.com/help/directory-sync-cli.md Get detailed help and examples for a specific command by using the --help option on that command. ```bash bwdc test --help ``` ```bash bwdc config --help ``` -------------------------------- ### Setup ZSH Shell Completion (Vendor) Source: https://bitwarden.com/help/cli.md Installs Bitwarden CLI ZSH shell completion by piping the completion script to the vendor completions directory. ```zsh bw completion --shell zsh | sudo tee /usr/share/zsh/vendor-completions/_bw ``` -------------------------------- ### Start Bitwarden Instance Source: https://bitwarden.com/help/install-on-premise-linux.md Start your Bitwarden instance after completing all prior configuration steps. The first start may take time as it downloads necessary Docker images. ```shell ./bitwarden.sh start ``` -------------------------------- ### Configure G Suite Key Source: https://bitwarden.com/help/directory-sync-cli.md Example command to configure your G Suite key after ensuring the keyring daemon is running and dependencies are installed. ```bash bwdc config gsuite.key /path/to/key/ ``` -------------------------------- ### Run Bitwarden Installation Script Source: https://bitwarden.com/help/install-on-premise-linux.md Executes the Bitwarden installation script. This command initiates the installation process and creates the './bwdata' directory. ```bash ./bitwarden.sh install ``` -------------------------------- ### Create Bitwarden Installation Directory Source: https://bitwarden.com/help/install-on-premise-linux.md Creates the '/opt/bitwarden' directory where Bitwarden will be installed. This directory will house the application files. ```bash sudo mkdir /opt/bitwarden ``` -------------------------------- ### Install Bitwarden SDK Source: https://bitwarden.com/help/ansible-integration.md Install the Bitwarden SDK using pip. It is recommended to do this within a Python virtual environment. ```bash pip install bitwarden-sdk ``` -------------------------------- ### Install Bitwarden CLI with Snap Source: https://bitwarden.com/help/cli.md Install the Bitwarden CLI on Linux distributions that support Snap packages. ```bash sudo snap install bw ``` -------------------------------- ### Download and Prepare Bitwarden Installer Source: https://bitwarden.com/help/install-on-premise-linux.md Downloads the Bitwarden installation script ('bitwarden.sh') and makes it executable. This script is used to install Bitwarden on Linux. ```bash curl -Lso bitwarden.sh "https://func.bitwarden.com/api/dl/?app=self-host&platform=linux" && chmod 700 bitwarden.sh ``` -------------------------------- ### Install Bitwarden Desktop App with Flatpak Source: https://bitwarden.com/help/cli.md Install the Bitwarden desktop application using Flatpak, which includes the CLI. ```bash flatpak install flathub com.bitwarden.desktop ``` -------------------------------- ### Download Bitwarden Installation Script Source: https://bitwarden.com/help/install-on-premise-windows.md Download the Bitwarden PowerShell installation script from the official Bitwarden download URL. ```powershell Invoke-RestMethod -OutFile bitwarden.ps1 -Uri "https://func.bitwarden.com/api/dl/?app=self-host&platform=windows" ``` -------------------------------- ### Install Keyring Dependencies Source: https://bitwarden.com/help/directory-sync-cli.md When configuring your private key and encountering keyring errors, ensure dbus-x11 and gnome-keyring are installed. ```bash sudo apt install dbus-x11 gnome-keyring ``` -------------------------------- ### CLI Get Notes Command Source: https://bitwarden.com/help/releasenotes.md Retrieve the notes for a specific Vault item using its ID with the `bw get notes` command. ```bash bw get notes ``` -------------------------------- ### Example Import Command with File Path Source: https://bitwarden.com/help/import-from-keeper.md An example of the `bw import` command, demonstrating how to specify a format and a file path for the data to be imported. ```bash bw import /Users/myaccount/Documents/mydata.csv ``` -------------------------------- ### Initial Organization Setup Checklist Source: https://bitwarden.com/help/bitwarden-onboarding-playbook.md Use this checklist to track the initial setup of your Bitwarden organization. It covers essential configuration steps for domain claiming, policies, and organizational structure. ```plaintext [ ] Configure domain claiming [ ] Set up enterprise policies for mandatory security controls [ ] Set up password and password generator minimums [ ] Organization data ownership enforcement to require all vault items in organization [ ] Create organizational structure - collections, groups [ ] Configure user roles and permissions ``` -------------------------------- ### Setup Dockerfile to Install Secrets Manager CLI Source: https://bitwarden.com/help/developer-quick-start.md Modify your Dockerfile to install necessary dependencies including `curl`, `jq`, and `unzip`, then download and install the Bitwarden Secrets Manager CLI (`bws`) binary. This allows secrets to be retrieved directly within the container at runtime. ```dockerfile # Install dependencies ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y \ ca-certificates \ curl \ jq \ unzip && \ rm -rf /var/lib/apt/lists/* # Download bws RUN curl -LO https://github.com/bitwarden/sdk/releases/download/bws-v1.0.0/bws-x86_64-unknown-linux-gnu-1.0.0.zip && \ unzip bws-x86_64-unknown-linux-gnu-1.0.0.zip -d /usr/local/bin/ && \ rm -f bws-x86_64-unknown-linux-gnu-1.0.0.zip # Add anything else you will need to your image ``` -------------------------------- ### Get Help for Specific BW CLI Command Source: https://bitwarden.com/help/cli.md Pass `--help` to any `bw` command to see its specific options and examples. ```bash bw list --help ``` ```bash bw move --help ``` -------------------------------- ### Get Help for BW CLI Source: https://bitwarden.com/help/cli.md Use the `--help` flag to view available commands and options for the Bitwarden CLI. ```bash bw --help ``` -------------------------------- ### Pre-setup Planning Checklist Source: https://bitwarden.com/help/bitwarden-onboarding-playbook.md Use this checklist to plan your Bitwarden self-hosted deployment, covering deployment methods, server specifications, network architecture, and key roles. ```plain text [ ] Choose self hosted deployment method (Linux standard/manual/offline, Windows standard/offline, or Kubernetes) [ ] Define server/VM specs and hosting environment (environment variables, firewall or proxy) [ ] Decide on SSL certificate approach [ ] Plan network architecture, firewall or proxy rules, access controls [ ] Scalability planning [ ] Select key roles [ ] Project lead [ ] Executive sponsor [ ] Server admin [ ] Docker admin [ ] Network admin [ ] Firewall admin [ ] Support/help desk admin [ ] Database admin [ ] Identity provider admin [ ] SMTP admin [ ] Security and compliance admin [ ] Backups admin [ ] Business continuity admin [ ] Disaster recovery admin [ ] Device management admin ``` -------------------------------- ### Get Fingerprint Phrase via CLI Source: https://bitwarden.com/help/fingerprint-phrase.md Use the Bitwarden CLI to retrieve your account's fingerprint phrase. Ensure the CLI is installed and authenticated. ```bash bw get fingerprint me ``` -------------------------------- ### Use Retrieved Secrets in a GitHub Actions Workflow Source: https://bitwarden.com/help/github-actions-integration.md Reference the secret names defined in the 'Get Secrets' step as environment variables in subsequent actions. This example shows how to use them with `SQLCMD`. ```yaml - name: Use Secret run: SQLCMD -S MYSQLSERVER -U "$SECRET_NAME_1" -P "$SECRET_NAME_2" ``` -------------------------------- ### Office 365 SMTP Configuration Source: https://bitwarden.com/help/smtp-configurations.md Example SMTP configuration for organizations using Microsoft Office 365. It is recommended to use a dedicated service account. Refer to Microsoft's documentation for detailed setup. ```bash globalSettings__mail__replyToEmail=bitwarden@yourdomain.com globalSettings__mail__smtp__host=smtp.office365.com globalSettings__mail__smtp__port=587 globalSettings__mail__smtp__ssl=false globalSettings__mail__smtp__username=bitwarden@yourdomain.com globalSettings__mail__smtp__password=your-secure-password ``` -------------------------------- ### Edit a login item's password Source: https://bitwarden.com/help/cli.md Use the 'edit' command to modify vault objects. This example shows how to change a login item's password by getting the item, manipulating it with jq, encoding, and then editing. ```bash bw get item 7ac9cae8-5067-4faf-b6ab-acfd00e2c328 | jq '.login.password="newp@ssw0rd"' | bw encode | bw edit item 7ac9cae8-5067-4faf-b6ab-acfd00e2c328 ``` -------------------------------- ### Create a new project Source: https://bitwarden.com/help/secrets-manager-cli.md Use this command to create a new project. Provide a name for the project. ```bash bws project create ``` ```bash bws project create "My project" ``` -------------------------------- ### Get and Inject Secret Value Source: https://bitwarden.com/help/access-tokens.md This example demonstrates how to retrieve a secret's value using its ID and an access token, then export it to an environment variable for use in a Docker container. Ensure the access token is valid and has the necessary permissions. ```bash ... export DB_PW=$(bws secret get fc3a93f4-2a16-445b-b0c4-aeaf0102f0ff --access-token 0.48c78342-1635-48a6-accd-afbe01336365.C0tMmQqHnAp1h0gL8bngprlPOYutt0:B3h5D+YgLvFiQhWkIq6Bow== | .jq '.value') ... docker run -d database ... -env DB_PW=$DB_PW ... mysql:latest ``` -------------------------------- ### Install Requests Module Source: https://bitwarden.com/help/migration-script.md Use pip3 to install the required 'requests' module for the migration script. Ensure Python v3 is installed. ```bash pip3 install requests ``` -------------------------------- ### Setup ZSH Shell Completion (Vanilla) Source: https://bitwarden.com/help/cli.md Adds Bitwarden CLI ZSH shell completion support by evaluating the completion script in your .zshrc file. ```zsh eval "$(bw completion --shell zsh); compdef _bw bw;" ``` -------------------------------- ### Install Build Essential Dependency on Linux Source: https://bitwarden.com/help/cli.md On Linux, installing the Bitwarden CLI via npm may require the 'build-essential' package. Install it using apt. ```bash apt install build-essential ``` -------------------------------- ### Rebuild Installation Assets Source: https://bitwarden.com/help/install-on-premise-windows.md Apply changes made to the `config.yml` file by rebuilding the installation assets. This command is used after modifying the configuration for specific installation scenarios. ```powershell .\bitwarden.ps1 -rebuild ``` -------------------------------- ### Setup ZSH Shell Completion (zinit) Source: https://bitwarden.com/help/cli.md Configures Bitwarden CLI ZSH shell completion for zinit by saving the completion script and then reinstalling completions. ```zsh bw completion --shell zsh > ~/.local/share/zsh/completions/_bw zinit creinstall ~/.local/share/zsh/completions ``` -------------------------------- ### Install Bitwarden CLI with NPM Source: https://bitwarden.com/help/cli.md Install the Bitwarden CLI globally using npm. This is the preferred method for users familiar with Node.js and npm for easy updates. ```bash npm install -g @bitwarden/cli ``` -------------------------------- ### Install Bitwarden Ansible Collection Source: https://bitwarden.com/help/ansible-integration.md Install the bitwarden.secrets Ansible collection using ansible-galaxy. ```bash ansible-galaxy collection install bitwarden.secrets ```