← All projects
Active October 2026

Vaultwarden on the NAS

My password manager, compatible with the Bitwarden apps, in my own house: reachable only from the local network and the VPN, with a valid certificate, consistent nightly backups and automatic updates with rollback.

VaultwardenDockerSynologyLet's EncryptSelf-hostingSecurity

The problem

My passwords lived in a commercial service’s cloud. It works well, but it’s the kind of data I’d rather keep at home. Vaultwarden is a lightweight, open-source implementation of the Bitwarden server: the same apps (phone, browser extensions, desktop) and the same experience, but the data sits on my NAS.

Home first, Internet (maybe) later

I chose to start from a closed setup: the service is reachable only from the local network and, away from home, through the WireGuard VPN — no ports opened on the router. The advantage is that the address is the same either way, so if I ever decide to expose it to the Internet I won’t have to reconfigure any app, just add a DNS record and a port forward, plus some hardening (mandatory two-factor authentication, the admin panel blocked from the outside).

“No ports open” was no longer true. A few days later I’d forwarded the router’s web ports to the NAS for other services, and the NAS’s proxy picks the destination by the name requested: without protection, my password manager also answered from the Internet, admin panel included. I found out by checking, not through an incident. The fix is an access-control profile on the proxy that lets in only the home network, the other house’s and the two VPNs. The catch: rules are read from the top and the NAS doesn’t deny by itself whatever isn’t listed; without a final “deny all” rule the profile blocked nothing. I tested from a mobile connection (refused), from the VPN and from home (accepted), and from the phone with the VPN on (it syncs). Going live on the Internet for real will mean removing the profile, but only after the protections are done.

How it’s built

A valid certificate without exposing anything

An address with “real” HTTPS needs a Let’s Encrypt certificate, and the convenient way to get one involves a server reachable from the Internet. I didn’t want to open anything, so I use DNS validation: the host proves it controls the domain by writing a temporary record. My domain provider has no API, and moving all the DNS elsewhere would have put the mail records at risk. The solution is a delegation: a single record points the validation at a free dynamic-DNS service, and there the acme.sh program writes and renews on its own. The rest of the zone was left untouched. The certificate is then imported into the NAS through a temporary administrator, so no password stays saved.

A NAS trap: on the Synology the temp folder is mounted so that nothing can be executed from it, and installing acme.sh failed cryptically until I ran the script through the shell instead of directly.

Backups you can actually restore

Copying the database file while Vaultwarden is using it can give a broken backup, so every night a small script takes a consistent hot dump, checks its integrity, and saves the keys, configuration and attachments with it, keeping fourteen days. Right after, the nightly backup of the whole containers folder runs, and a copy goes off-site too. On top of that, now and then I export the vault to a password-protected file and keep it offline.

Automatic updates, with a parachute

A password manager can’t be left behind on security fixes, but it isn’t updated blindly either. I didn’t use Watchtower, because it requires giving a container control of Docker, which I don’t want with a possible exposure in mind. Every night a script on the NAS checks for a new version and, if there is one: takes a preventive backup, sets the current image aside, recreates the container and waits for it to report healthy. If it doesn’t start, it rolls back on its own to the previous version, restores the database from the backup, and emails me. The images use the “latest stable” tag: with a pinned version, automatic updating would never find anything, and if a version ever goes to rollback I just pin it temporarily.

Two small first-day lessons

A guide for the family

A password manager only works if everyone uses it. For the family I prepared a six-page guide in Italian, generated by a script and kept in the same repository: how to sort logins into folders, how to move them from the old service, how to save cards, and how the family organisation works, with its collections for shared credentials. A note to anyone writing guides: I made up an example table for the collections and couldn’t check the menu names on the real apps, so they need checking before it’s handed out.

Status

Installed and running since 11 October 2026, after exporting both the personal vault and the shared ones from the cloud. Two checks are still open and I’m stating them: a restore test of a backup in a trial container, and a look at the log after the first real update, because the automatic rollback has never really been put to the test. I’ll keep the cloud account for a few more weeks.

Stack

Vaultwarden · Docker · Synology Container Manager · SQLite · acme.sh · Let’s Encrypt · WireGuard