How can I solve namespace conflicts with the dashboard api?

Hey Traefik Community,

first of all I really like Traefik and I use it for quite a while. Yesterday I upgraded to version two and I really appreciate the effort the whole Traefik Team put in the software.

Here my problem: I have a service named 'api' which i cannot rename. I use docker-compose in my setup and would like to make use of the dashboard api. On default my routes are called like the services in docker-compose. How would I go about handling the naming collision?

    image: api:latest
    container_name: api
      - traefik.http.routers.api.rule=Host(``)

In this example the routers.api refers to the dashboard api.

And one more question. How can I set the dashboard on one of my subdomains, like

Best regards,




the <name> must be unique.

You can use something like that:

    image: traefik:v2.0.0
      - 80:80
      - --api
      - --entrypoints.web.address=:80
      - --providers.docker.exposedbydefault=false
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(``)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.routers.traefik.entrypoints=web"

1 Like

Also with the defaultRule you can generate "smart" Host rule

So i can still use the api as a custom service? I got mixed up because the docs use api as service name :stuck_out_tongue:

Thank you for the fast reply!

1 Like