# Enabling the file provider in Traefik V2

**URL:** <https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005>\
**Category:** Traefik v2\
**Tags:** file\
**Created:** [July 23, 2019, 3:28pm UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005 "2019-07-23T15:28:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/seh/32/487_2.png) [@seh](https://community.traefik.io/u/seh)\
**Post date:** [July 23, 2019, 3:28pm UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005/1 "2019-07-23T15:28:48Z")

</div>

Using Traefik version 2.0.0-beta1, I'm attempting to enable the file provider. According to [the documentation](https://github.com/containous/traefik/blob/master/docs/content/providers/file.md#traefik--file), we can write dynamic configuration in the main Traefik configuration file:

> You can write these configuration elements:
> 
> - At the end of the main Traefik configuration file (by default: `traefik.toml` / `traefik.yml` / `traefik.yaml` ).

We also see examples of enabling the file provider specifying none of its optional fields:

```yaml
providers:
  file: {}

```

When I try to do so in my main _traefik.yaml_ file, Traefik fails immediately with the following message:

> command traefik error: file cannot be a standalone element (type \*file.Provider)

Is this an unintentional regression? Is the documentation wrong?

---

<div class="post-metadata">

**Author:** ![dduportal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/dduportal/32/4_2.png) [@dduportal](https://community.traefik.io/u/dduportal)\
**Post date:** [July 23, 2019, 4:19pm UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005/2 "2019-07-23T16:19:55Z")

</div>

Hi @seh, the documentation to use is the online website at [https://docs.traefik.io/v2.0](https://docs.traefik.io/v2.0).

In particular, you are interested in this page: [https://docs.traefik.io/v2.0/providers/file/](https://docs.traefik.io/v2.0/providers/file/).

With the latest `v2.0.0-beta1`, you must separate the static configuration from the dynamic configuration.

For your configuration, it means that you must specify a `providers.file.filename` attribute (hence the error message you have that expects either a `filename` or `directory` attribute).

I agree with you on the documentation page not clear enough: would you be willing to improve it by contributing?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![seh](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/seh/32/487_2.png) [@seh](https://community.traefik.io/u/seh)\
**Post date:** [July 23, 2019, 11:00pm UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005/3 "2019-07-23T23:00:01Z")

</div>

Figuring out which documentation pages pertain to what's true in version 2 has been difficult. Which page do you think should mention this restriction?

---

<div class="post-metadata">

**Author:** ![SantoDE](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/santode/32/393_2.png) [@SantoDE](https://community.traefik.io/u/SantoDE)\
**Post date:** [July 24, 2019, 8:12am UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005/4 "2019-07-24T08:12:37Z")

</div>

Hey seh!

I guess on the page @dduportal mentioned.

---

<div class="post-metadata">

**Author:** ![dduportal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/dduportal/32/4_2.png) [@dduportal](https://community.traefik.io/u/dduportal)\
**Post date:** [July 29, 2019, 2:04pm UTC](https://community.traefik.io/t/enabling-the-file-provider-in-traefik-v2/1005/5 "2019-07-29T14:04:02Z")

</div>

Hello @seh, as the version `v2.0` is still worked on, the documentation is absolutely not complete and is evolving step by step. But it is really a hard work.

Would you be interested in proposing a contribution, as it's Open Source, any help from the community is appreciated 🙂
