# Vaultwarden and 2FA/webauthn

**URL:** <https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376>\
**Category:** General Discussion\
**Created:** [27 February 2022 14:46 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376 "2022-02-27T14:46:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![huidbui25](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/85f322/32.png) [@huidbui25](https://dietpi.com/forum/u/huidbui25)\
**Post date:** [27 February 2022 14:46 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376/1 "2022-02-27T14:46:31Z")

</div>

Hi!

I use DietPi and installed Vaultwarden through dietpi-software. Runs smoothly. Now I wanted to use Vaultwarden’s webauthn feature. But when trying to active it, vaultwarden displays an error “domain variable not set”.

I looked for a solution and found this article:  
[https://github.com/dani-garcia/vaultwarden/wiki/Enabling-U2F-(and-FIDO2-WebAuthn)-authentication](https://github.com/dani-garcia/vaultwarden/wiki/Enabling-U2F-%28and-FIDO2-WebAuthn%29-authentication)

But how does that relate to DietpI installed by dietpi-software? What do I have to do?

I own a domain if that is of use?!

---

<div class="post-metadata">

**Author:** ![Parkour\_Lama](https://dietpi.com/forum/user_avatar/dietpi.com/parkour_lama/32/2461_2.png) [@Parkour\_Lama](https://dietpi.com/forum/u/Parkour_Lama)\
**Post date:** [27 February 2022 15:15 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376/2 "2022-02-27T15:15:30Z")

</div>

Going off the solution you listed, your domain needs to added to the vaultwarden config file.  
Since you’ve installed though dietpi-software, you can modify the vaultwarden.env from in /mnt/dietpi\_userdata/vaultwarden

The line you need to uncomment called DOMAIN= & add you domain next to it. Restart, & it should work.  
A verified certificate from Let’s Encrypt should be used as well.

---

<div class="post-metadata">

**Author:** ![huidbui25](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/h/85f322/32.png) [@huidbui25](https://dietpi.com/forum/u/huidbui25)\
**Post date:** [27 February 2022 16:11 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376/3 "2022-02-27T16:11:58Z")

</div>

Oh thank you very much for that hint. 🙂 I didn’t know that file.

Can ‘domain’ also be a local IP like domain=https://192.168.1.20:8001? Because that’s how I access vaultwarden, it’s runs locally.

I imported the locally signed HTTPS certificate to my browser, so it doesnt show a warning.

How can I add a Let’s Encrypt certificate to my local vaultwarden??

---

<div class="post-metadata">

**Author:** ![Parkour\_Lama](https://dietpi.com/forum/user_avatar/dietpi.com/parkour_lama/32/2461_2.png) [@Parkour\_Lama](https://dietpi.com/forum/u/Parkour_Lama)\
**Post date:** [27 February 2022 16:22 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376/4 "2022-02-27T16:22:51Z")

</div>

Unfortunately, you cannot have a signed certificate for a local IP address AFAIK.  
You’ll need add the LetsEncrypt Cert to you webserver config file for the vaultwarden website/reverse proxy.  
[The Vaultwarden docs](https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples) have a bunch of reverse proxy examples you can use.

Finally for the ‘domain’ part, a local IP address method is the default way to access, adding it to domain won’t help unfortunately.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [27 February 2022 21:45 UTC](https://dietpi.com/forum/t/vaultwarden-and-2fa-webauthn/6376/5 "2022-02-27T21:45:19Z")

</div>

is there a plan to access Vaultwarden from outside of your network? if not, what is the purpose of having 2FA activated?
