# Helloworld Swarm Mode not working at all

**URL:** <https://community.traefik.io/t/helloworld-swarm-mode-not-working-at-all/4249>\
**Category:** Traefik v2\
**Tags:** docker-swarm, docker\
**Created:** [February 3, 2020, 10:05pm UTC](https://community.traefik.io/t/helloworld-swarm-mode-not-working-at-all/4249 "2020-02-03T22:05:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex.rowe](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@alex.rowe](https://community.traefik.io/u/alex.rowe)\
**Post date:** [February 3, 2020, 10:05pm UTC](https://community.traefik.io/t/helloworld-swarm-mode-not-working-at-all/4249/1 "2020-02-03T22:05:00Z")

</div>

Hello, I am trying to get ANY stack to work with traefik and swarm mode. I have tried many different configurations and get no services or routers that appear in the dashboard.

I have tried many configs but here is one:  
What am I doing wrong? I have tried it on both v2.0, v2.1 and different machines  
Nothing shows up in the dashboard

```auto
version: "3.3"

services:
  nginx: 
    image: nginxdemos/hello
    ports: 
      - 5000:80
    networks: 
      - mynet
      
    labels: 
      - traefik.enable=true
      - traefik.http.routers.nginx.service=my_service
      - traefik.http.services.my_service.loadbalancer.server.port=80
      - traefik.http.routers.nginx.rule=Host(`foo`)

    deploy: 
      placement:
        constraints:
          - node.labels.leader==true
  traefik: 
    image: traefik:v2.1
    ports: 
      - 8080:8080
      - 80:80
    command: --api.insecure=true --providers.docker --providers.docker.swarmMode=true --providers.docker.network=mynet
    volumes: 
      - /var/run/docker.sock:/var/run/docker.sock
    networks: 
      - mynet
      
    deploy: 
      placement:
        constraints:
          - node.labels.leader==true
        
networks: 
  mynet:
    external:
      name: mynet

```

Thanks!

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [February 3, 2020, 10:11pm UTC](https://community.traefik.io/t/helloworld-swarm-mode-not-working-at-all/4249/2 "2020-02-03T22:11:34Z")

</div>

Hello,

> Therefore, if you use a compose file with Swarm Mode, labels should be defined in the [`deploy`](https://docs.docker.com/compose/compose-file/#labels-1) part of your service.

> **[Traefik Docker Documentation - Traefik](https://doc.traefik.io/traefik/v2.1/providers/docker/)**
>
> Learn how to achieve configuration discovery in Traefik through Docker. Read the technical documentation.

---

<div class="post-metadata">

**Author:** ![alex.rowe](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@alex.rowe](https://community.traefik.io/u/alex.rowe)\
**Post date:** [February 4, 2020, 7:54pm UTC](https://community.traefik.io/t/helloworld-swarm-mode-not-working-at-all/4249/3 "2020-02-04T19:54:53Z")

</div>

This worked, thanks!  
I didn't realize service labels were under deployment instead of the service name.
