# Vaultwarden service can't access data folder

**URL:** <https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797>\
**Category:** Help\
**Created:** [August 6, 2022, 10:15am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797 "2022-08-06T10:15:55Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 6, 2022, 10:15am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/1 "2022-08-06T10:15:55Z")

</div>

Hi, I’m trying to install Vaultwarden on my server, but after creation of service, when I start it, it couldn’t access to the data folder.

Environement :

- User and Group : bitwarden
- Installation folder : /opt/vaultwarden
- Data folder : /home/bitwarden/vaultdata

The installation and data folder are set to bitwarden user and group, with drwxr-xr-x mode …

But when I start the service, the service return the status failed, with this error :

```auto
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [INFO] No .env file found.
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [2022-08-06 11:59:23.192][vaultwarden][ERROR] Data folder '/home/bitwarden/v>
Aug 06 11:59:23 smtp.magicseeserver vaultwarden[9351]: [2022-08-06 11:59:23.192][vaultwarden][ERROR] Create the data folder and try>
Aug 06 11:59:23 smtp.magicseeserver systemd[1]: vaultwarden.service: Main process exited, code=exited, status=1/FAILURE
Aug 06 11:59:23 smtp.magicseeserver systemd[1]: vaultwarden.service: Failed with result 'exit-code'.

```

Service has this 3 options set :  
User=bitwarden  
Group=bitwarden  
EnvironmentFile=/etc/vaultwarden.env

Could you help me please ?

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [August 6, 2022, 12:54pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/2 "2022-08-06T12:54:26Z")

</div>

Make sure the data folder has the correct rights. 775 or something.

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 6, 2022, 2:30pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/3 "2022-08-06T14:30:34Z")

</div>

Yes, the data folder was at 755, I tried with 775, but same result

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [August 6, 2022, 2:50pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/4 "2022-08-06T14:50:20Z")

</div>

Then i’m not sure what or why. Try `777`. If that helps then there is something wrong with the user/group

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 6, 2022, 2:54pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/5 "2022-08-06T14:54:44Z")

</div>

It’s strange … same issue with 777 …

Is it possible to start vaultwarden directly without service ? I tried, but it doesn’t found the .env file

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [August 6, 2022, 3:12pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/6 "2022-08-06T15:12:01Z")

</div>

It can start with a service file.  
Just point either run the Vaultwarden binary from the location where the .env file is located, or place the .env file at the same location as the binary, and run it from there.

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 6, 2022, 7:57pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/7 "2022-08-06T19:57:32Z")

</div>

It’s strange I made a link of .env file into binary file … And running can’t find .env …

 ![image](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/cdf980f516c3eb8f54617d14a7a933bce916faf2.png)

I also try to copy file instead of link … Same issue

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [August 6, 2022, 8:56pm UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/8 "2022-08-06T20:56:56Z")

</div>

The file needs to be named `.env` as the message indicates, not `vaultwarden.env`.

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 7, 2022, 7:30am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/9 "2022-08-07T07:30:10Z")

</div>

mmmh no, same issue with .env file :

 ![image](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/b06f17f6033b1b80b9a717144839a9fdd96060a0.png)

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 7, 2022, 7:34am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/10 "2022-08-07T07:34:30Z")

</div>

Hum, it seems to be definitively a service problem … If I start the execution file, it’s ok, it start and create all files in data folder … But If I start service, it says :

[ERROR] Data folder ‘/home/bitwarden/vaultdata’ doesn’t exist.

---

<div class="post-metadata">

**Author:** ![xNiux](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/xniux/32/736_2.png) [@xNiux](https://vaultwarden.discourse.group/u/xNiux)\
**Post date:** [August 7, 2022, 9:24am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/11 "2022-08-07T09:24:43Z")

</div>

OK, solved, I have to duplicate .env in vaultwarden folder and in EnvironementFile for the service.

If it is only in EnvironementFile, but not in vaultwarden folder, service say “no .env file”, but use also the EnvironementFile.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [August 7, 2022, 10:02am UTC](https://vaultwarden.discourse.group/t/vaultwarden-service-cant-access-data-folder/1797/12 "2022-08-07T10:02:30Z")

</div>

The .env file **INFO** message is because Vaultwarden it self couldn’t find that file it self.

If you load that file via systemd or any other option it’s normal that Vaultwarden doesn’t see that file it self. And it doesn’t need to.

Vaultwarden needs the environment populated with all the config options. Systemd does this for you. Or Vaultwarden tries to read a .env file when available.

So tldr, when using systemd, you will get that message. And it is no issue.
