The Dashboard

See What’s Going On

The dashboard is the central place that shows you the current active routes handled by Traefik.

Dashboard - Providers

The dashboard in action

The dashboard is available at the same location as the API but on the path /dashboard/ by default.

The trailing slash / in /dashboard/ is mandatory

There are 2 ways to configure and access the dashboard:

There is also a redirect of the path / to the path /dashboard/, but one should not rely on that property as it is bound to change, and it might make for confusing routing rules anyway.

Secure Mode

This is the recommended method.

Start by enabling the dashboard by using the following option from Traefik’s API on the static configuration:

File (YAML)

  1. api:
  2. # Dashboard
  3. #
  4. # Optional
  5. # Default: true
  6. #
  7. dashboard: true

File (TOML)

  1. [api]
  2. # Dashboard
  3. #
  4. # Optional
  5. # Default: true
  6. #
  7. dashboard = true

CLI

  1. # Dashboard
  2. #
  3. # Optional
  4. # Default: true
  5. #
  6. --api.dashboard=true

Then define a routing configuration on Traefik itself, with a router attached to the service api@internal in the dynamic configuration, to allow defining:

Dashboard Router Rule

As underlined in the documentation for the api.dashboard option, the router rule defined for Traefik must match the path prefixes /api and /dashboard.

We recommend using a “Host Based rule” as Host(`traefik.example.com`) to match everything on the host domain, or to make sure that the defined rule captures both prefixes:

Host Rule

  1. # The dashboard can be accessed on http://traefik.example.com/dashboard/
  2. rule = "Host(`traefik.example.com`)"

Path Prefix Rule

  1. # The dashboard can be accessed on http://example.com/dashboard/ or http://traefik.example.com/dashboard/
  2. rule = "PathPrefix(`/api`, `/dashboard`)"

Combination of Rules

  1. # The dashboard can be accessed on http://traefik.example.com/dashboard/
  2. rule = "Host(`traefik.example.com`) && PathPrefix(`/api`, `/dashboard`)"

Dashboard Dynamic Configuration Examples

Docker

  1. # Dynamic Configuration
  2. labels:
  3. - "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
  4. - "traefik.http.routers.dashboard.service=api@internal"
  5. - "traefik.http.routers.dashboard.middlewares=auth"
  6. - "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"

Docker (Swarm)

  1. # Dynamic Configuration
  2. deploy:
  3. labels:
  4. - "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
  5. - "traefik.http.routers.dashboard.service=api@internal"
  6. - "traefik.http.routers.dashboard.middlewares=auth"
  7. - "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
  8. # Dummy service for Swarm port detection. The port can be any valid integer value.
  9. - "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"

Kubernetes CRD

  1. apiVersion: traefik.io/v1alpha1
  2. kind: IngressRoute
  3. metadata:
  4. name: traefik-dashboard
  5. spec:
  6. routes:
  7. - match: Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
  8. kind: Rule
  9. services:
  10. - name: api@internal
  11. kind: TraefikService
  12. middlewares:
  13. - name: auth
  14. ---
  15. apiVersion: traefik.io/v1alpha1
  16. kind: Middleware
  17. metadata:
  18. name: auth
  19. spec:
  20. basicAuth:
  21. secret: secretName # Kubernetes secret named "secretName"

Consul Catalog

  1. # Dynamic Configuration
  2. - "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
  3. - "traefik.http.routers.dashboard.service=api@internal"
  4. - "traefik.http.routers.dashboard.middlewares=auth"
  5. - "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"

Marathon

  1. "labels": {
  2. "traefik.http.routers.dashboard.rule": "Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))",
  3. "traefik.http.routers.dashboard.service": "api@internal",
  4. "traefik.http.routers.dashboard.middlewares": "auth",
  5. "traefik.http.middlewares.auth.basicauth.users": "test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
  6. }

Rancher

  1. # Dynamic Configuration
  2. labels:
  3. - "traefik.http.routers.dashboard.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
  4. - "traefik.http.routers.dashboard.service=api@internal"
  5. - "traefik.http.routers.dashboard.middlewares=auth"
  6. - "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"

File (YAML)

  1. # Dynamic Configuration
  2. http:
  3. routers:
  4. dashboard:
  5. rule: Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))
  6. service: api@internal
  7. middlewares:
  8. - auth
  9. middlewares:
  10. auth:
  11. basicAuth:
  12. users:
  13. - "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/"
  14. - "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"

File (TOML)

  1. # Dynamic Configuration
  2. [http.routers.my-api]
  3. rule = "Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
  4. service = "api@internal"
  5. middlewares = ["auth"]
  6. [http.middlewares.auth.basicAuth]
  7. users = [
  8. "test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/",
  9. "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0",
  10. ]

Insecure Mode

This mode is not recommended because it does not allow the use of security features.

To enable the “insecure mode”, use the following options from Traefik’s API:

File (YAML)

  1. api:
  2. dashboard: true
  3. insecure: true

File (TOML)

  1. [api]
  2. dashboard = true
  3. insecure = true

CLI

  1. --api.dashboard=true --api.insecure=true

You can now access the dashboard on the port 8080 of the Traefik instance, at the following URL: http://<Traefik IP>:8080/dashboard/ (trailing slash is mandatory).


Using Traefik for Business Applications?

If you are using Traefik in your organization, consider our enterprise-grade solutions:

These tools help businesses discover, deploy, secure, and manage microservices and APIs easily, at scale, across any environment.