# Enable HTTPS for Traefik dashboard

**URL:** <https://community.traefik.io/t/enable-https-for-traefik-dashboard/2044>\
**Category:** Traefik v2\
**Tags:** docker-swarm\
**Created:** [September 30, 2019, 1:13pm UTC](https://community.traefik.io/t/enable-https-for-traefik-dashboard/2044 "2019-09-30T13:13:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aleksvujic](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/aleksvujic/32/4885_2.png) [@aleksvujic](https://community.traefik.io/u/aleksvujic)\
**Post date:** [September 30, 2019, 1:13pm UTC](https://community.traefik.io/t/enable-https-for-traefik-dashboard/2044/1 "2019-09-30T13:13:35Z")

</div>

I want to access Traefik dashboard on port 9000 using HTTPS. If I access whoami website on port 5000, HTTPS works as it should. How can I make HTTPS work for dashboard on port 9000 as well? Here is my configuration:

**docker-compose-traefik.yml**

```auto
version: "3.7"

services:
  traefik:
    image: "traefik:v2.0"
    networks:
      - traefik-net
    ports:
      - "9000:9000"
      - "5000:5000"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./config/:/etc/traefik/"
      - "./cert/:/cert/"
    deploy:
      replicas: 1
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.traefik.rule=Host(`example.com`)"
        - "traefik.http.routers.traefik.entrypoints=traefik"
        - "traefik.http.routers.traefik.tls=true"
        - "traefik.http.services.traefik.loadbalancer.server.port=8080"

networks:
  traefik-net:
    external: true
    name: traefik-net

```

**docker-compose-whoami.yml**

```auto
version: "3.7"

services:
  whoami:
    image: "jwilder/whoami"
    networks:
      - traefik-net
    deploy:
      replicas: 3
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.whoami.rule=Host(`example.com`)"
        - "traefik.http.routers.whoami.entrypoints=web"
        - "traefik.http.routers.whoami.tls=true"
        - "traefik.http.services.whoami.loadbalancer.server.port=8000"
        - "traefik.http.services.whoami.loadbalancer.sticky=true"
        - "traefik.http.services.whoami.loadbalancer.sticky.cookie.name=StickyCookie"
        - "traefik.http.services.whoami.loadbalancer.sticky.cookie.secure=true"

networks:
  traefik-net:
    external: true
    name: traefik-net

```

**config/traefik.yml**

```auto
log:
  level: DEBUG

api:
  insecure: true
  dashboard: true

providers:
  file:
    directory: "/etc/traefik"
    watch: true
  docker:
    swarmMode: true
    exposedByDefault: false

entrypoints:
  traefik:
    address: ":9000"
  web:
    address: ":5000"

```

**config/dynamic\_conf.yml**

```auto
tls:
  certificates:
    - certFile: /cert/example.com.cert
      keyFile: /cert/example.com.key

```

---

<div class="post-metadata">

**Author:** ![zespri](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/zespri/32/310_2.png) [@zespri](https://community.traefik.io/u/zespri)\
**Post date:** [September 30, 2019, 7:08pm UTC](https://community.traefik.io/t/enable-https-for-traefik-dashboard/2044/2 "2019-09-30T19:08:01Z")

</div>

You need to use [api@internal](https://docs.traefik.io/operations/api/#configuration) to reference the dashboard service.

There is a working example [here](https://community.containo.us/t/traefik-2-0-swarm-not-working-with-services-on-ports/1877/9) that exposes the dashboard, that you might want to refer to.
