# Vaultwarden ignores .env file

**URL:** https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140
**Category:** Troubleshooting
**Tags:** vaultwarden
**Created:** [3 December 2022 14:23 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140 "2022-12-03T14:23:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [3 December 2022 14:23 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/1 "2022-12-03T14:23:10Z")

</div>

I did some testing to get fail2ban working with vaultwarden and I noticed on the journalctl log it showed:

```auto
[INFO] No .env file found.

```

I did some research and found out that a file namen `.env` (without any name before the `.`) has to be placed in the working directory. (`WorkingDirectory=/mnt/dietpi_userdata/vaultwarden`)  
Info Source: [https://vaultwarden.discourse.group/t/i-cannot-figure-out-how-to-source-the-env-file/948/17](https://vaultwarden.discourse.group/t/i-cannot-figure-out-how-to-source-the-env-file/948/17)

Altough there is an entry in the systemd unit file `EnvironmentFile=/mnt/dietpi_userdata/vaultwarden/vaultwarden.env` but I think this had to be symlinked to `/mnt/dietpi_userdata/vaulwarden/.env`.  
I did not try with a symlink, I just renamed `vaultwarden.env` to `.env` and the info in journalctl went away.

---

<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: [3 December 2022 18:23 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/2 "2022-12-03T18:23:50Z")

</div>

> [@Jappe](#):
>
> `[INFO]`

hmm it’s a normal `[INFO]` message. Not really an error. Not sure if there are downside of not having the `.env` file available 🤔

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [3 December 2022 22:38 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/3 "2022-12-03T22:38:28Z")

</div>

In this file are already made some configs (like the data directory is set to `/mnt/dietpi_userdata/vaultwarden`), so it looks like it’s working?  
In the systemd unit is also set a path to this file. So maybe it’s used because of the systemd unit? But if I would start vaultvarden manually, without systemd, the file would be ignored due to “false” naming?

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [4 December 2022 00:37 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/4 "2022-12-04T00:37:05Z")

</div>

And maybe I found another thing:  
In the unit file there is a line: `ReadWritePaths=-/mnt/dietpi_userdata/vaultwarden`  
I think the `-` behind the `=` is a typo?!

---

<div class="post-metadata">

### Author: ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)
#### Post date: [4 December 2022 01:21 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/5 "2022-12-04T01:21:55Z")

</div>

I can confirm:  
The `vaultwarden.env` gets not ignored, I changed the port of the web UI and it worked, but it sill showed this `[INFO]`. So I think it’s a bug?!

---

<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: [4 December 2022 13:45 UTC](https://dietpi.com/forum/t/vaultwarden-ignores-env-file/15140/6 "2022-12-04T13:45:36Z")

</div>

> [@Jappe](#):
>
> So I think it’s a bug?!

maybe a feature. Would need to be checked with Vaultwarden guys what the intention of the message is.
