Building Your Own Password Management System with Docker Based on Bitwarden
This article was last updated 287 days ago. The information within may have evolved or changed; if anything is outdated or broken, please feel free to leave a message in the comments section.
Article Abstract
To address the issues of scattered multi-platform password management and unmet needs for automatically generating complex passwords, Docker is used to deploy the open-source solution Vaultwarden (an alternative Bitwarden image) to build a self-hosted password management system. By configuring a domain name via reverse proxy, cross-device access is achieved, completing account initialization, language settings, and Chrome extension integration, with support for importing existing password vaults from Chrome and macOS systems. This solution solves the problem of unified password management, achieving cross-platform (iOS, Android, Windows, Mac) password synchronization and automatic generation, while enhancing data control through self-hosting, making it suitable for personal password security management needs in home data center scenarios.
Qwen3-14B · 2026-06-18

Preface

Regarding password management, I believe it is a headache for the vast majority of people, including myself in the past... For a long time, I have been using two password management systems: one is the password management provided by Google that comes with Chrome, which is for websites; the other is built into the Mac system, which is for the system itself and installed apps. Actually, this works well enough, as long as you can ignore the "password leaked" warnings that Chrome frequently prompts~~. As for password leaks, I've become numb to them—let them leak—but there's no way a lazy person like me is going to change the passwords for so many websites. At most, I started using two-factor authentication (2FA) for important websites, and because of 2FA, I actually set simpler passwords instead—as long as they are easy to remember, relying on 2FA for security... As for app passwords, when setting them, I could only use the few passwords I was used to. In fact, this is also a helpless move; it is quite difficult to set complex passwords for so many apps and websites. Chrome can automatically generate complex passwords, but the password management tool built into the Mac system doesn't have this feature... And Chrome's built-in password management tool is sometimes unreliable; the login pages of some websites won't autofill the password, forcing me to go into the browser settings to look it up myself.

After much thought, I decided to just set up my own password management system. This way, I can use a single solution to uniformly solve password management issues for both websites and system apps, automatically generate complex passwords, and reduce my management costs. After all, as I get older, my memory is not as good as it used to be. I looked into LastPass, KeePass, and bitwarden, and finally chose the open-source, self-hosted bitwarden. Since I am committed to building a home data center, I prefer to self-host whatever I can. Moreover, bitwarden supports automatic password generation, import/export functions, and is more than enough for average users. It also supports deployment across multiple system platforms via its apps:

image.png

image.png

These completely meet all my needs, so this is the one!

Deployment

Create the folder on the host machine that needs to be mapped into the bitwarden container

As usual, first create the folders required for the -v parameter mount:

mkdir -p /docker/bitwarden/data

Deploy bitwarden (Vaultwarden)

Note: The official bitwarden image on hub.docker hasn't been updated for over 2 years. Now everyone uses the Vaultwarden version, which has over 100M+ downloads:

image.png

The security should be trustworthy.

The command in docker run format is as follows:

docker run  --name vaultwarden -d --restart=always \
  -v /docker/bitwarden/data:/data/ \
  -p 9500:80 \
  vaultwarden/server:latest

Publish using an available domain name

-v /docker/bitwarden/data:/data/ \

-p 9500:80 \
1、Docker Series: Building Your Own Reverse Proxy Based on NPM Using Docker
2、Linux Panel Series: Configuring Reverse Proxy and Publishing Using Non-443 Ports
3、Home Data Center Series: Getting Cloudflare for Free via Domestic ICP-Filed Cloud Hosts to Achieve Fast Access to Domestic Sites from Abroad
4、Home Data Center Series: Getting Cloudflare for Free via Home Broadband Without Public IP to Achieve Fast Website Building (Universal)

Among them, the 1st and 2nd methods are suitable for environments with a public IP but without a legal 443 port (home broadband, non-filed cloud hosts), where non-standard ports need to be added after the URL (if using Cloudflare to build a website, no port needs to be added, but you need to customize the origin server port, which you can refer to:Home Data Center Series: Solving the Problem of Having a Public IP but No Legal 80 or 443 Ports for Website Building via Cloudflare's Origin Rules). The 3rd method is suitable for cloud hosts with ICP filing, and the 4th method is suitable for all environments (including environments without a public IP), which is also my recommended method (regardless of whether your environment has a public IP, because this method does not require running HTTPS traffic directly on the public network).


vaultwarden/server:latest


Since I need to use this password management system on multiple devices (iPhone, iPad, Win, Mac), self-hosted cross-platform applications like this usually need to provide a valid, accessible external link (no need for port 80 or 443) so that all devices using the app can connect under various network environments (similar to Nextcloud). The same goes for bitwarden, so it needs to be published externally.

Initialize bitwarden

Create account and password

You should choose the publishing method that best suits you based on your actual environment and the reverse proxy you use. You can refer to several of my previous articles:

image.png

I will write an article in the future to summarize all publishing methods and link to the specific deployment articles for each method. However, I need to finish writing the relevant prerequisite articles first~ After all, there are too many knowledge points involved, and I cannot cover them all in a single article.
image.png

Assuming the final domain name is pwd.example.com, which will be used later.

image.png

image.png

Assuming you have completed the domain publishing for bitwarden according to the previous chapter, and the domain and port are bitwarden.example.com:55555, use http(s)://bitwarden.example.com:55555/admin to log in:
image.png

Set language

Since there is no account for the first login, click "Create account" in the red box at the bottom to create an account:

image.png

The fields in the red box in the image above are required. "Email address" is required and serves as the login account. "Master password" is the master password, which is the only password you need to remember. This password is extremely important, so please ensure it is complex enough and that you can remember it correctly (of course, you can also set a simple, easy-to-remember master password and set up two-step verification in "Account Settings" - "Security" to ensure safety). Finally, click "Create account" below to create the account. After creation, return to the initial login page and log in using the email you just created:
image.png

Successfully logged in:
image.png

Directly click "Account settings" in the red box at the top right of the page:

Import passwords

Select "Preferences" in the red box, choose "zh-CN" in the red box under "Language", and then click "Save":

image.png

At this point, it will lock and require you to enter your master password to unlock:

image.png

After unlocking, the page will switch to the Chinese interface.
image.png

From the "Account Settings" - "Tools" - "Import Data" interface, you can import password text exported from other applications. You can select the format of the imported text in the "File Format" dropdown in the red box:
image.png


Taking importing a CSV text exported from Chrome as an example, select the Chrome (csv) option in the red box under "File Format":
Then select the password file exported from Chrome in the red box, and click "Import Data" in the red box below:

image.png

Similarly, you can import password files exported from macOS:
image.png

Different applications have different ways of exporting passwords, so I cannot list them all here. I will just demonstrate using Chrome and macOS password exports as examples.


In Chrome, it is located in "Settings" under the Google Password Manager's "Settings", as shown in the red box below:

image.png

Install client

Chrome browser extension

Install extension

While in macOS, it is in "System Settings" - "Passwords":

image.png

Other similar applications also have places where passwords can be exported; you will need to explore this on your own.
image.png

Finally, after importing the password vaults from Chrome and macOS, all the password vaults I usually use have been imported:
image.png

Search for "bitwarden" in the Chrome Web Store and install it:
image.png

Click the newly installed extension in the browser's extension bar, and select "Self-hosted" from the dropdown menu button to the right of "Log in to" in the red box:
image.png

Fill in the previously configured domain name in the "Server URL" field on the page below. If it is an unregistered domain, just append it with :port, and then click Save in the red box at the top right:
image.png

Configure Chrome extension

Enter the email address you used when registering the account earlier, and then click Continue in the red box:

Enter the master password you set earlier, and then click "Log in with master password" in the red box:
By default, auto-fill is basically unusable and needs to be configured. Click "Settings" in the rightmost red box at the bottom right, and then select "Auto-fill" in the red box at the top:

image.png

The 2 red boxes in the image below are the settings that need to be changed:
image.png

As shown in the figure below, I have set the auto-fill shortcut to command+Q:
image.png

The default URI match detection "Base domain" cannot correctly detect when there are multiple hostnames under the same second-level domain, or when the same second-level domain has multiple different ports, so I changed it to "Host".

Security:

image.png

Here you determine how often you need to enter the master password to unlock. The default is 1 hour. I think for a personal computer, setting it to "Never" is fine to avoid hassle.

Some tips and tricks

The number at the bottom right of the extension icon indicates that the website opened in this tab has one matching item:

image.png

The built-in self-destructing "Send" can transmit text and files, and you can set expiration times, access counts, passwords, and other information:
image.png

image.png

image.png

Password generator, which allows you to specify the complexity of the password:
image.png

image.png

Send and the generator can also be used in the web version.

iOS and iPadOS clients

The installation for iOS and iPadOS is done directly from the App Store. The settings interface and steps are exactly the same as the Chrome extension, so I won't go into detail. The key point is to replace the system-level default iCloud password verification:
The settings path for both iOS and iPadOS is: "Settings" - "Passwords" - "Password Options":

image.png

If you have a two-factor authentication app, you can also select it here, such as my Authy. Once configured, Bitwarden can completely take over the default "iCloud Passwords & Keychain".

macOS client

I do not recommend this because, unlike iOS and iPadOS, even if you install Bitwarden on macOS, there is no way to select it in the password options. I personally estimate this is due to macOS permission restrictions, which makes installing the macOS client not very useful. Therefore, it is recommended to just use the Chrome extension directly on both Mac and Windows.

Afterword

Once all password management is handed over to Bitwarden, the stability of the Bitwarden application becomes the top priority. You can consider running two Bitwarden applications in different local Docker environments and setting up local hot standby (via local load balancing), or utilizing the hot standby origin server feature provided by CDNs to use the Bitwarden in your home data center and the Bitwarden on your cloud server as the primary and hot standby origins. This way, you can ensure that Bitwarden is always online (which is the method I currently use), though this approach requires considering the issue of regularly syncing the password database.

Taking Tencent Cloud as an example, the settings interface is as follows:

image.png

View Related Categories · 3 Matches
📌 Content Structure Prompt:
This content is part of the following knowledge map, where you can view the complete content path: Blog Knowledge Map。
📎 Related Articles
Share this article
The blog content is original, please indicate the source when reposting! The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if needed, you can join theTelegram Groupto discuss questions together.
No Comments

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗ
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Kaomoji
Emoji
Little Dinosaur
Flower!
Previous
Next
       

👋 Welcome to “Wudi's Personal Blog”

Here, long-term exploration is mainly carried out around the following directions:

🧱 Personal Digital Infrastructure and Blog System Construction
☁️ Cloudflare and Network Architecture Practice
🧠 AI and Knowledge System Exploration
🛡️ Network Security and Access Optimization
🎵 Music and Sound Cognition
👁️ Cognitive Perspectives and Worldviews