# No .env file found with Docker compose

**URL:** <https://vaultwarden.discourse.group/t/no-env-file-found-with-docker-compose/1893>\
**Category:** Help\
**Created:** [September 24, 2022, 5:05am UTC](https://vaultwarden.discourse.group/t/no-env-file-found-with-docker-compose/1893 "2022-09-24T05:05:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ironyn](https://avatars.discourse-cdn.com/v4/letter/i/e5b9ba/32.png) [@Ironyn](https://vaultwarden.discourse.group/u/Ironyn)\
**Post date:** [September 24, 2022, 5:05am UTC](https://vaultwarden.discourse.group/t/no-env-file-found-with-docker-compose/1893/1 "2022-09-24T05:05:59Z")

</div>

Hello,  
I’m quite new to docker and server stuffs.  
I have my docker-compose.yml like follow,

```auto
version: '3'

services:
  webserver:
    build:
      context: ./nginx/
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/html/:/usr/share/nginx/html/:ro
      - ./nginx/conf/:/etc/nginx/conf.d/:ro
    links:
      - vaultwarden
  vaultwarden:
    image: vaultwarden/server:latest
    ports:
      - 8080:80
      - 3012:3012
    volumes:
      - ./vault/data/:/data/
    env_file:
      - vaultwarden.env

```

I have vaultwarden.env in the same level as docker-compose.yml. Still when I docker compose up, vualtwarden shows there’s no .env file found. Further I’ve also created just .env file on the same level. Still no updates.

My goal is to use vaultwarden in sub-dir. I need to setup DOMAIN for that as per my understanding from wiki.

Thank you.

---

<div class="post-metadata">

**Author:** ![mcfisch](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@mcfisch](https://vaultwarden.discourse.group/u/mcfisch)\
**Post date:** [September 26, 2022, 6:16pm UTC](https://vaultwarden.discourse.group/t/no-env-file-found-with-docker-compose/1893/2 "2022-09-26T18:16:03Z")

</div>

Try noting the file location with a qualified relative path:

```auto
env_file:
  - ./vaultwarden.env

```

---

<div class="post-metadata">

**Author:** ![stefan0xC](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/stefan0xc/32/1765_2.png) [@stefan0xC](https://vaultwarden.discourse.group/u/stefan0xC)\
**Post date:** [September 26, 2022, 9:04pm UTC](https://vaultwarden.discourse.group/t/no-env-file-found-with-docker-compose/1893/3 "2022-09-26T21:04:54Z")

</div>

> [@Ironyn](#):
>
> vualtwarden shows there’s no .env file found

See BlackDex’ explanation: [I cannot figure out how to source the .env file - #4 by BlackDex](https://vaultwarden.discourse.group/t/i-cannot-figure-out-how-to-source-the-env-file/948/4)

The `.env` file mentioned in the logs is unrelated to the environment file used by docker (or systemd). While launching, vaultwarden checks for the existence of such a file in the current working directory of the container and simply informs you if it does not find it.

You could probably bind mount your `vaultwarden.env` file to `/.env` instead of specifying it as environment file for docker if you want to get rid of the message.
