Expose dashboard in Traefik V3

I have the following docker-compose very similar to the simple example often posted in this forum:

services:
  traefik:
    image: traefik:v3.5
    ports:
      - 80:80
      - 443:443
    networks:
      traefik:
        ipv4_address: 192.168.200.10
      nat_bridge:
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /volume1/docker/traefik/letsencrypt:/etc/traefik/letsencrypt
    command:
      - --log.level=DEBUG
      - --api.dashboard=true
      - --accesslog=true
      - --providers.docker=true
      - --providers.docker.network=mvl-200
      - --providers.docker.exposedbydefault=false
      - --entryPoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entrypoints.web.http.redirections.entrypoint.scheme=https
      - --entryPoints.websecure.address=:443
      - --entrypoints.websecure.asDefault=true
      - --entrypoints.websecure.http.tls.certresolver=duckdns
      - --certificatesresolvers.duckdns.acme.dnschallenge=true
      - --certificatesresolvers.duckdns.acme.dnschallenge.provider=duckdns
      - --certificatesresolvers.duckdns.acme.email=info@acme.com
      - --certificatesresolvers.duckdns.acme.storage=/etc/traefik/letsencrypt/acme.json
    environment:
      - "DUCKDNS_ACCESS_TOKEN=<redacted>"
      - "LEGO_DISABLE_CNAME_SUPPORT=true"
    labels:
      - traefik.enable=true
      - traefik.http.routers.mydashboard.rule=Host(`traefik.acme.com`)
      - traefik.http.routers.mydashboard.service=api@internal
      - traefik.http.routers.mydashboard.middlewares=myauth
      - traefik.http.middlewares.myauth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/
      
  whoami:
    image: traefik/whoami
    networks:
      traefik:
        ipv4_address: 192.168.200.20
    labels:
      - traefik.enable=true
      - traefik.http.routers.whoami.rule=Host(`whoami.acme.com`) || Host(`www.whoami.acme.com`)
      - traefik.http.services.whoami.loadbalancer.server.port=80


networks:
  traefik:
    name: mvl-200
    external: true
  nat_bridge:
    driver: bridge

It works in Docker on my Synology NAS and it automatically fetches certificates for the whoami service, but during start-up I see an error for the traefik service:

ERR github.com/traefik/traefik/v3/pkg/provider/docker/config.go:81 > error="service "traefik-traefik" error: port is missing" container=traefik-traefik-1a2cd6cb1cc3bd4e9d11acbb4dde6ea8bc122ae11ec0a2c1601c895b8e0b0ab1 providerName=docker

I thought I don't need to set a port for the traefik service as it's already specified as "api@internal"? How else can I expose the dashboard for me?

I just tested, the example still works for me with Traefik v3.5 on latest Debian.

It seems the only difference is your use of VLAN(?) and explicit IPs.

Wait, I would expect this --providers.docker.network=mvl-200 not to work, have you tried with =traefik there?


The usual note, :ro does not work on sockets, creates false sense of security:

    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro