Trouble getting Traefik Dashboard access

Hi,

I am new to Traefik and got it set up working on docker compose and a couple containers, through docker and external. All that is working fine, but I am unable to get access to the dashboard. I have been digging around for a couple days.

When I put traefik.local into my browser I get: 404 page not found
and with http://192.168.1.5:8080 it's unable to connect.

Port 8080 is free and not connected to any other services.

I think I am missing something. Any help would be appreciated. Thank you!

Here is my docker-compose:

version: "3.3"
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - "80:80"
      - "443:443"
    networks:
      - network
    command:
      - "--configfile=/etc/traefik/traefik.yml"
      - "--api.dashboard=true"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /compose/traefik:/etc/traefik

networks:
  network:
    driver: bridge
    attachable: true

my traefik.yml:

# /etc/traefik/traefik.yml
http:
  routers:
    dashboard:
      rule: Host(`traefik.local`)
      service: api@internal

api:
  dashboard: true

entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"

providers:
  file:
    filename: /etc/traefik/config.yml
    watch: true
  docker:
    exposedByDefault: false

certificatesResolvers:
  le:
    acme:
      email: xxx@yyy.zzz
      storage: /etc/traefik/acme.json
      tlsChallenge: {}

and config.yml:

# /etc/traefik/config.yml
http:
  services:
    omv-service:
      loadBalancer:
        servers:
          - url: "http://192.168.1.5:81"

  routers:
    omv-router:
      entryPoints:
        - web
      rule: "Host(`omv.local`)"
      service: omv-service

This does not work. Either traefik.yml file or command: (doc). Here dashboard has no effect.

You did not set insecure for dashboard, so Traefik will not automatically create an entrypoint on 8080. Also you did not publish 8080 with ports: on the container.

If you bind-mounted your traefik.yml file correctly, then Traefik dashboard should be available at http://traefik.local/dashboard/ (on the created entrypoints).

But you need to ensure that traefik.local is resolved via DNS or hosts file to the correct IP. traefik.localhost might work with browser and Traefik on the same machine.

Note that for TLS to be used, it has to be assigned to entrypoint or router, maybe check simple Traefik example.

Note that :ro does not work for sockets, so it has no effect:

Thank you very much for your help. It is VERY confusing for a newbie.

So going through your list

  • I removed the dashboard from command
  • added insecure to traefik.yml (traefik.yml OR command: as you mentioned)
  • added the entrypoint and :8080 to traefik.yml
  • traefik.local is correctly resolved locally (I can ping traefik.local and it returns the correct IP)
  • not doing TLS for now
  • removed :ro

It still doesn't work. I do get a "404 page not found" on traefik.local which I believe means that something is responding vs. when I use the IP nothing happens. I verified that traefik.yml is read since I accidentally had a typo in it and it complained about that, so it is reading it and also the omv.local is working.

Thank you for your help!! It looks like this now:

docker-compose:

version: "3.3"
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    networks:
      - network
    command:
      - "--configfile=/etc/traefik/traefik.yml"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /compose/traefik:/etc/traefik

networks:
  network:
    driver: bridge
    attachable: true

traefik.yml:

# /etc/traefik/traefik.yml
http:
  routers:
    dashboard:
      rule: Host(`traefik.local`)
      service: api@internal
      entryPoints:
        - webapi

api:
  dashboard: true
  insecure: true

entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"
  webapi:
    address: ":8080"

providers:
  file:
    filename: /etc/traefik/config.yml
    watch: true
  docker:
    exposedByDefault: false

certificatesResolvers:
  le:
    acme:
      email: my@email.domain
      storage: /etc/traefik/acme.json
      tlsChallenge: {}

config.yml

# /etc/traefik/config.yml
http:
  services:
    omv-service:
      loadBalancer:
        servers:
          - url: "http://192.168.1.5:81"

  routers:
    omv-router:
      entryPoints:
        - web
      rule: "Host(`omv.local`)"
      service: omv-service

will generate a default entrypoint with name "traefik" on port 8080. Maybe that conflicts with your declared "webapi".

In general I recommend not to use insecure, but do your own routing, add password protection, like in the linked example.

I removed the webapi entrypoint in row 7,8 and 19, 20 of the traefik.yml but I still get the 404 error. So you were correct in that it opens something, since I observe literally no change. With that said I still have no access to the webapi.

I just wanted to get it up insecure first since that is easier to set up than going through the whole secure setup introducing way more failure points.

I had it working when I had everything in the docker compose, but in that scenario the external routing isn't possible since that works only with the dynamic configuration. Changing that made the api not work any more and I just can't figure out why.

It seems external forward in labels will work in upcoming Traefik v3.4 (pull).

Just add labels for the dashboard on Traefik service:

    labels:
      - traefik.enable=true
      - traefik.http.routers.mydashboard.rule=Host(`traefik.example.com`)
      - traefik.http.routers.mydashboard.service=api@internal
      - traefik.http.routers.mydashboard.middlewares=myauth
      - traefik.http.middlewares.myauth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/

Well, guess what. I got it to work right now with 3.3.5.
The labels category seems to have fixed it. I just thought I'd give it a try.
I feel like something is redundant, though.
Thank you so much for your help!

This is the current working config:

docker-compose:

version: "3.3"
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    networks:
      - network
    command:
      - "--configfile=/etc/traefik/traefik.yml"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /compose/traefik:/etc/traefik
    labels:
      - traefik.enable=true
      - traefik.http.routers.dashboard.rule=Host(`traefik.local`)
      - traefik.http.routers.dashboard.service=api@internal

networks:
  network:
    driver: bridge
    attachable: true

traefik.yml:

# /etc/traefik/traefik.yml
api:
  dashboard: true
  insecure: true

entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"

providers:
  file:
    filename: /etc/traefik/config.yml
    watch: true
  docker:
    exposedByDefault: false

certificatesResolvers:
  le:
    acme:
      email: my@email.tld
      storage: /etc/traefik/acme.json
      tlsChallenge: {}

config.yml

# /etc/traefik/config.yml
http:
  services:
    omv-service:
      loadBalancer:
        servers:
          - url: "http://192.168.1.5:81"

  routers:
    omv-router:
      entryPoints:
        - web
      rule: "Host(`omv.local`)"
      service: omv-service

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.