123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Self-Hosting Bitwarden Password Vault with Docker</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="Browser Based,Docker Made Easy,Home Lab,Home Lab Ideas,Install Guide,Self-Hosted,Web Based,Web Based Tools,Bitwarden,Bitwarden Install Guide,Browser Add-On,Homelab,How To Self-Host Bitwarden,Password Locker,Password Manager,Password Tracking,Password Vault,Security,Self-Hosted Bitwarden Server,Self-Hosted Password Tracker,Self-Hosted Password Vault,Linux,Ubuntu,Docker,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Self-Hosting Bitwarden Password Vault with Docker">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="02/10/2023 12:40:53 PM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Self-Hosting Bitwarden Password Vault with Docker</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>What is Bitwarden?</h2>
- <blockquote><em>Bitwarden is a free/freemium open-source password management service that stores sensitive information such as website credentials in an encrypted vault. The platform offers a variety of client applications including a web interface, desktop applications, browser extensions, mobile apps, and a command-line interface. Bitwarden offers a free cloud-hosted service as well as the ability to self-host. -<a href="https://en.wikipedia.org/wiki/Bitwarden" target="_blank">https://en.wikipedia.org/wiki/Bitwarden</a></em></blockquote>
- <h2>Installing Docker</h2>
- <ol>
- <li>Log into the Linux based device</li>
- <li>Run the following commands in the terminal
- <div class="codeBlock"># install prerequisites<br />
- sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
- # add docker gpg key<br />
- curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -<br />
- # add docker software repository<br />
- sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"<br />
- # install docker<br />
- sudo apt install docker-ce docker-compose containerd.io -y<br />
- # enable and start docker service<br />
- sudo systemctl enable docker && sudo systemctl start docker<br />
- # add the current user to the docker group<br />
- sudo usermod -aG docker $USER<br />
- # reauthenticate for the new group membership to take effect<br />
- su - $USER</div>
- </li>
- </ol>
- <h2>Running Bitwarden Containers</h2>
- <p><em>NOTE: In order for Let's Encrypt to verify ownership of the DNS name, the host Docker is running from must be accessible via port 80 (http) and port 443 (https). For homelab users, this will normally involve port forwarding from the router to the certbot host, which is beyond the scope of this tutorial. </em></p>
- <ol>
- <li>Open a web browser and navigate to https://bitwarden.com/host/</li>
- <li>Enter an email address > Click the Submit button</li>
- <li>Copy the Installation ID and Key from the output for use later</li>
- <li>Continue with the following commands in a terminal window
- <div class="codeBlock"># create a working directory<br />
- mkdir ~/docker/bitwarden -p<br />
- # create a bitwarden user account<br />
- sudo adduser bitwarden --disabled-password<br />
- # add the bitwarden user to the docker group<br />
- sudo usermod -aG docker bitwarden<br />
- # create bitwarden install directory<br />
- sudo mkdir /opt/bitwarden<br />
- # set permissions on the install directory<br />
- sudo chmod -R 700 /opt/bitwarden<br />
- # set ownership of install directory to bitwarden<br />
- sudo chown -R bitwarden:bitwarden /opt/bitwarden<br />
- # cd into the working directory<br />
- cd ~/docker/bitwarden<br />
- # download the bitwarden installation script<br />
- curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh<br />
- # make the install script executable<br />
- chmod 700 bitwarden.sh<br />
- # execute the installation script<br />
- ./bitwarden.sh install</div>
- </li>
- <li>When prompted, enter a domain name for the Bitwarden installation</li>
- <li>Select if you'd like to use Let's Encrypt for SSL certificates</li>
- <li>Enter a database name to be used for the Bitwarden instance</li>
- <li>Enter the Installation ID obtained earlier</li>
- <li>Enter the Installation Key obtained earlier</li>
- <li>Select if you have an SSL certificate to use</li>
- <li>If no to the above, select if you'd like to generate a self-signed SSL certificate</li>
- <li>Continue with the following commands in a terminal window
- <div class="codeBlock"># edit .env file<br />
- nano ~/docker/bitwarden/bwdata/env/global.override.env</div>
- </li>
- <li>Update the SMTP host configuration to use and optionally, add admin email addresses as shown below
- <p>globalSettings__mail__replyToEmail=no-reply@i12bretro.local<br />
- globalSettings__mail__smtp__host=smtp.i12bretro.local<br />
- globalSettings__mail__smtp__port=25<br />
- globalSettings__mail__smtp__ssl=false<br />
- globalSettings__mail__smtp__username=bitwarden@i12bretro.local<br />
- globalSettings__mail__smtp__password=<br />
- <br />
- adminSettings__admins=i12bretro@i12bretro.local</p>
- </li>
- <li>Continue with the following commands in a terminal window
- <div class="codeBlock"># restart bitwarden containers<br />
- ~/docker/bitwarden/bitwarden.sh restart</div>
- </li>
- <li>Open a web browser and navigate to https://DNSorIP</li>
- <li>Click the Create Account button</li>
- <li>Complete the form by entering an Email Address, Name and Master Password > Click the Create Account button</li>
- <li>Log into Bitwarden using the email address and password set earlier</li>
- <li>Welcome to Bitwarden</li>
- </ol>
- <p>Documentation: <a href="https://bitwarden.com/help/install-on-premise-linux/#post-install-configuration" target="_blank">https://bitwarden.com/help/install-on-premise-linux/#post-install-configuration</a></p>
- <p>Source: <a href="https://bitwarden.com/help/install-on-premise-linux/" target="_blank">https://bitwarden.com/help/install-on-premise-linux/</a></p> </div>
- </div>
- </body>
- </html>
-
|