Last updated on 4 February 2024
Important or Recent Updates
|New Guide for Container Manager
|Edited Argon2 / Admin Token Section as $$ in the hash are not required via the Container Manager UI
|Adjusted the Reverse Proxy for WebSockets
|Migrated the guide from the Container Manager UI to Projects as provides much easier updates as well as the added ability to use more docker compose variables such as the security amends.
Added additional security option to the compose to restrict the container from gaining new privileges, including the container running using our restricted docker user.
|Updated formatting of guide in line with the recent updates across the site
Fixed a regression in the guide in relation to the Argon2 hash (my apologies) and added the creation of the log folder as it is required.
|Removed port 3012 as no longer required for WebSocket notifications
What is Vaultwarden/Bitwarden?
Vaultwarden is a rewrite of the official Bitwarden server using the Rust language, it was created to reduce the need for the number of containers required for the official server.
It is compatible with all the official Bitwarden apps and Browser extensions. It is a great way to self-host a password manager it gives you complete control over your passwords and allows you to have automatic syncing across web, desktop and mobile apps.
This guide contains three parts:
- Part 1 — Setting up the container
- Part 2 — Setting up DDNS, Reverse Proxy and SSL
- Part 3 — Setting up the Bitwarden Clients
Before we start head over to the short guides below to set up a restricted Docker user and Bridge Network.
Part 1 — Container Set up
Let’s start by getting some folders set up for the containers to use. Open up File Station create the following.
Next we are going to set up a ‘Project’ in Container Manager. Open up Container Manager and click on Project then on the right-hand side click ‘Create’.
In the next screen we will set up our General Settings.
Next we are going to drop in our docker compose configuration, copy all the code in the box below and paste it into line ‘1’ just like the screenshot.
user: UID:GID #AMEND AS PER GUIDE
ADMIN_TOKEN: #YOUR ARGON ADMIN TOKEN
Making some amendments
We need to make some amendments to the compose information above to secure our instance.
|This line controls the user the container runs as we want to ensure it uses the dockerlimited user and group, amend the UID and GID to the ones you noted in the earlier set up guide.
|As of version 1.28 of Vaultwarden it is recommended to create an Argon2 hashed admin token rather than using a plaintext one. We will be doing this via the Argon2 Hash Generator online if you wish to do this via SSH follow the instructions here.
Go to https://argon2.online/ and enter the variables in the table below into the form and then press ‘Generate Hash’.
|Variable to Select or Enter
|Plain Text Input
|Enter either a long string of characters or a secure long ‘password’ you will use this to log in to your admin panel, so it needs to be secure, and you must remember it!
|Press the Cog it will generate a random string of characters
|Three Argon Versions
As you can see above we have generated our hash, however we need to make an adjustment to it otherwise it will not be valid for the compose.
If you see below the hash contains 5 occurrences of $ we need to escape these out by doubling them to $$
Once you have made the edits and added into the correct line in the yaml you can click ‘Next’
You do not need to enable anything on the ‘Web portal settings’ screen click ‘Next’ again.
On the final screen click ‘Done’ which will begin the download of the container images and once downloaded they will be launched!
You should now be able to access the web interface via the IP of your NAS followed by the port 8122
You will not be able to register an account yet, as you must have a valid SSL certificate in place.
(Skip if you don’t have the Firewall configured)
If you have enabled and configured the Synology Firewall you will need to create exceptions for any containers that have a Web UI or have any incoming or outgoing connections. This section covers the basics of how to add these. (Please note this is a generic section and will not show the specific ports used in this guide however it applies in the same way)
Also, I would like to refer people to the great guide on getting the Firewall correctly configured over on WunderTechs site.
Head into the
Firewall, from here click
Edit Rules for the profile you set up when you enabled the Firewall.
Next click on
Create and you will see the screen below. Source IP and Action will be automatically selected to All and Allow, I will leave it up to you as to your own preference on whether you want to lock down specific Source IPs from having access. In this example we will leave as All.
You will now choose ‘Custom‘ and then the
Now select Destination from the drop-down menu, most web based containers require TCP access but check the guide as it will show the port and protocol. Then add comma separated ports. Then press OK.
Click OK a couple of times to get back to the main screen. You will see by default the new rule is added to the bottom of the list. You must always have your Block All rule last in the list as the rules are applied top down so move your container up.
You have now completed the Firewall changes and can continue with the guide.
Part 2 – DDNS, SSL and Reverse Proxy
Before we start, make sure you have registered for a Synology Account as we are going to be using their DDNS service. https://account.synology.com/en-uk/register/
In order to successfully use the reverse proxy you will also need to forward port 443 to you NAS IP. (You will need to check how to do this on your own router) This port will be used for secure web traffic.
A DDNS address allows you to get external access to Vaultwarden and other services via a subdomain provided by Synology, this is useful on home internet connections where your ISP may change your IP address on a regular basis.
Note: If you want to access DSM via this new address you will either need to create an additional Reverse Proxy for it or open port 5001 on your router.
In the DSM Control panel go to ‘External Access’ and then to the ‘DDNS’ tab
Click on ‘Add’, then fill out the following sections.
|This can be anything it will be used to access your NAS externally
|Log into your Synology account
|External Address (IPv4)
|This should be filled in automatically
|External Address (IPv6)
|This should be filled in automatically if your ISP is using IPv6
|Get a Cert from Let’s Encrypt
|Tick this box
|Tick this box
Now press OK, DSM will apply your settings. It can take a few moments to set up and the DSM interface will refresh. You will likely receive a certificate error which you will need to accept to get back into DSM.
So you don’t have to open up additional ports on your router for Vaultwarden we are going to set up a reverse proxy subdomain. This means you can access Vaultwarden without using a port number as it will route all traffic through the secure 443 port.
This can be used for any service on your NAS, it will see the address asked for and internally redirect the request to the port number specified.
Go back into the Control Panel and access the ‘Login Portal’ then in the ‘Advanced’ tab click ‘Reverse Proxy’ and then click on ‘Create’.
We are now going to enter some rules, so when you access the URL specified you will automatically be sent to Vaultwarden web UI.
Use the settings below, you will need to amend the Hostname section in line with the hostname you registered earlier, and the IP of your NAS.
|Reverse Proxy Name:
|bitwarden.xxx.synology.me (change the part after ‘bitwarden.’ to your own hostname you registered earlier.
|Your NAS IP or localhost
Next click on the ‘Custom Header’ tab and click Create ‘WebSocket’ and then press Save.
You should now be able to access the Bitwarden (Vaultwarden) web UI by going to https://bitwarden.yourhostname it will be a secure connection, and you should have no SSL errors.
Setting up the Admin Settings
As we disabled sign-ups via the main log in screen you will need to invite yourself and any other users from the admin panel.
Go to bitwarden.yourhostname.me/admin
Enter the admin token which is the string of text or ‘password’ you used to create the Argon2 token (you don’t use the actual Argon2 string).
We need to change a few options to enable user sign up emails. (Please note that you will not be able to use Gmail SMTP in this step as they have disabled ‘unsecure’ 3rd party application login. Also, if you plan on using Yahoo you will need to set up an app specific password – as shown in this guide)
In General Settings. Amend the Domain URL to your own.
Next you will need to amend your own email settings in the SMTP Email Settings section.
This will need to be in line with your email provider, once you have entered the details click Save at the bottom of the screen, you can then send a test email to yourself to ensure its working.
The final step will be to send yourself an invitation email via the Users’ panel at the top of the page. This allows you to create an account by clicking the link in the email.
You have now successfully set up Vaultwarden.
Part 3 — Setting Up the Bitwarden Clients.
Now you have set up Vaultwarden you can use the various Mobile, Desktop or Browser Add-ons.
It’s very easy to point these to your personal self-hosted version. In the main login screen click the ‘Logging in on:’ and select ‘Self-hosted’
In the pop-up screen enter your full address for the server e.g. https://vaultwarden.xyz.synology.me
You have now completed the guide.
Q) I am receiving the notice “You are using a plain text
ADMIN_TOKEN which is insecure.”
A) A recent update changed the Admin Token used to access the admin panel to make it more secure. You can follow the next steps to migrate over.
- Follow the section of the guide to create the Argon2 token, you can use the existing ‘password’ aka admin token for this as it will still be used for the actual admin login screen, Important: when you get to the part that asks you to add the additional $ into the token skip that and come back here.
- Stop the Project and then edit the yaml and completely remove the existing
- Start the container again and login to the admin panel with your usual admin password. Scroll down to the bottom of the General Settings section and paste your Argon2 hash into the
Admin token/Argon2 PHCoption and save the settings.
- Restart the project again, and you will now be using the new hash and can log in with your usual password
Buy Me a Coffee or a Beer
If you have found my site useful please consider pinging me a tip as it helps cover the cost of running things or just lets me get the odd beverage. Plus 10% goes to the devs of the apps I do guides for every year.