# Dashboard not working with domain

**URL:** <https://community.traefik.io/t/dashboard-not-working-with-domain/21552>\
**Category:** Traefik v2\
**Tags:** dashboard-api\
**Created:** [February 18, 2024, 1:47pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552 "2024-02-18T13:47:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![klapvogn](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@klapvogn](https://community.traefik.io/u/klapvogn)\
**Post date:** [February 18, 2024, 1:47pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/1 "2024-02-18T13:47:25Z")

</div>

Hi,

I have this in my docker-composer.yml

```auto
  traefik:
    container_name: traefik
    image: traefik:alpine
    restart: always
    networks:
      - skynet
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen   
    ports:
      - 80:80
      - 443:443
      - 8080:8080
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /home/klapvogn/docker/data/traefik/config/traefik.toml:/etc/traefik/traefik.toml
      - /home/klapvogn/docker/data/traefik/config/acme.json:/acme.json
    labels:
      - "traefik.http.routers.dashboard.rule=Host(`traefik.domain.tld`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=xxxx:xxxx" 

```

It works when I do : IP:8080/dashboard/  
but not when I do : traefik.domain.tld

what have I done wrong?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 18, 2024, 1:57pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/2 "2024-02-18T13:57:39Z")

</div>

Share your static config `traefik.toml`.

---

<div class="post-metadata">

**Author:** ![klapvogn](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@klapvogn](https://community.traefik.io/u/klapvogn)\
**Post date:** [February 18, 2024, 1:58pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/3 "2024-02-18T13:58:37Z")

</div>

```auto
defaultEntryPoints = ["http", "https"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[retry]

[api]
  dashboard = true

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "domain.tld"
watch = true
exposedbydefault = false
defaultrule = "Host(`{{ index .Labels \"com.docker.compose.service\" }}.domain.tld`)"

[acme]
email = "xxxx"
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
  [acme.httpChallenge]
  entryPoint = "http"

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 18, 2024, 2:09pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/4 "2024-02-18T14:09:12Z")

</div>

Doesn’t make sense. You have no 8080 `entrypoint` and no `api.insecure=true`. There should be nothing listening on port 8080.

Check [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt).

---

<div class="post-metadata">

**Author:** ![klapvogn](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@klapvogn](https://community.traefik.io/u/klapvogn)\
**Post date:** [February 18, 2024, 2:22pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/5 "2024-02-18T14:22:38Z")

</div>

So how do I add 8080 to the entrypoint?  
I have added

```auto
[api]
  dashboard = true
  insecure = true

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 18, 2024, 2:41pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/6 "2024-02-18T14:41:39Z")

</div>

What do you want to achieve? With `insecure` an automatic entrypoint on 8080 is created.

You need to use `traefik.domain.tld/dashboard/`.

---

<div class="post-metadata">

**Author:** ![klapvogn](https://avatars.discourse-cdn.com/v4/letter/k/f19dbf/32.png) [@klapvogn](https://community.traefik.io/u/klapvogn)\
**Post date:** [February 18, 2024, 2:49pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/7 "2024-02-18T14:49:34Z")

</div>

I have now been looking at : [simple Traefik example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-traefik-dashboard-letsencrypt) an I have this now:

```auto
  traefik:
    container_name: traefik
    image: traefik:alpine
    restart: always
    networks:
      - skynet
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Copenhagen   
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /home/xxx/docker/data/traefik/config/traefik.toml:/etc/traefik/traefik.toml
      - /home/xxx/docker/data/traefik/config/acme.json:/acme.json
    labels:
      - traefik.enable=true
      - traefik.http.routers.mydashboard.rule=Host(`whoami.domain.tld`)
      - traefik.http.routers.mydashboard.service=api@internal
      - traefik.http.routers.mydashboard.middlewares=myauth
      - traefik.http.middlewares.myauth.basicauth.users=klapvogn:xxxx

  whoami:
    image: traefik/whoami:v1.8
    networks:
      - skynet
    labels:
      - traefik.enable=true
      - traefik.http.routers.mywhoami.rule=Host(`whoami.domain.tld`) || Host(`www.whoami.domain.tld`)
      - traefik.http.services.mywhoami.loadbalancer.server.port=80

      - traefik.http.middlewares.mywwwredirect.redirectregex.regex=^https://www\.(.*)
      - traefik.http.middlewares.mywwwredirect.redirectregex.replacement=https://$${1}
      - traefik.http.routers.mywhoami.middlewares=mywwwredirect 

```

So the link you linked does not use `traefik.toml` ?

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [February 18, 2024, 3:13pm UTC](https://community.traefik.io/t/dashboard-not-working-with-domain/21552/8 "2024-02-18T15:13:10Z")

</div>

Traefik static config can be in `traefik.yml/.toml` or in `command`.
