# \[Need Help\] Traefik + Docker Swarm

**URL:** <https://community.traefik.io/t/need-help-traefik-docker-swarm/27801>\
**Category:** Traefik v3 (latest)\
**Tags:** docker-swarm\
**Created:** [June 26, 2025, 12:11am UTC](https://community.traefik.io/t/need-help-traefik-docker-swarm/27801 "2025-06-26T00:11:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Komiriko](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/komiriko/32/10497_2.png) [@Komiriko](https://community.traefik.io/u/Komiriko)\
**Post date:** [June 26, 2025, 12:11am UTC](https://community.traefik.io/t/need-help-traefik-docker-swarm/27801/1 "2025-06-26T00:11:29Z")

</div>

Hello,

I hope you are doing well.

I need some help because the documentation is far too unclear for me. I tried to configure Traefik with **Docker Swarm** to access the dashboard via `0.0.0.0/dashboard/`, but I keep getting a `404 not found`.  
Here is my Docker Compose configuration for Traefik:

_docker-compose.yml_

```yml
services:
####### Traefik #######
  reverse-proxy:
    image: traefik:latest
    command:
      # ————————— Dashboard ————————— #
      - --api=true

      # —————— Provider Docker —————— #
      - --providers.swarm.exposedByDefault=false
      - --providers.swarm.endpoint=unix:///var/run/docker.sock

      # ———————— Entrypoint ————————— #
      - --entrypoints.web.address=:80
    ports:
      - target: 80
        published: 80
        mode: host
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - proxy-network
    deploy:
      mode: replicated
      replicas: 1
      placement:
        constraints: [node.role == manager]
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`0.0.0.0`)"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=admin:$$2y$$10$$1t34DNgXSMiNlZEtNSGFuO65fc37tPuqD6av5Px6YZIj9aFBd.DTW"
#######################

##### SWARM NETWORK #####
networks:
  proxy-network:
    driver: overlay
    attachable: true
#########################

```

`docker swarm init`  
`docker stack deploy -c docker-compose.yml traefik`

---

<div class="post-metadata">

**Author:** ![romgo](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@romgo](https://community.traefik.io/u/romgo)\
**Post date:** [June 27, 2025, 7:47pm UTC](https://community.traefik.io/t/need-help-traefik-docker-swarm/27801/2 "2025-06-27T19:47:44Z")

</div>

> [@Komiriko](#):
>
> some help because the documentation is far too unclear for me. I tried to config

Hello,  
I struggle also a bit. I see you labels is not well configured should be under deploy  
Here is my config :

```auto
version: "3.3"

services:
  traefik:
    environment:
      - TZ=Europe/Paris
    image: "traefik:latest"
    command: # Static traefik config
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --providers.swarm=true
      - --api=true
      - --accesslog=true  
      - --providers.swarm.exposedbydefault=false
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    deploy:
      labels:
        - "traefik.enable=true"
        #Traefik Router Setup
        - "traefik.http.routers.dashboard.rule=Host(`traefik.domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
        - "traefik.http.routers.dashboard.service=api@internal"
        - "traefik.http.routers.dashboard.middlewares=auth"
        - "traefik.http.middlewares.auth.basicauth.users=admin: ****"
        - "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"
      restart_policy:
        condition: any
      placement:
        constraints: [node.role == manager]

```

for the admin password on a linux with htpasswd installed run :  
`htpasswd -c /tmp/password admin`

This will generate a has that you can place in the stack file.

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [June 28, 2025, 6:35am UTC](https://community.traefik.io/t/need-help-traefik-docker-swarm/27801/3 "2025-06-28T06:35:35Z")

</div>

Check [simple Traefik Swarm example](https://github.com/bluepuma77/traefik-best-practice/tree/main/docker-swarm-traefik).

Note that you can not access a service at `0.0.0.0`. That address is only a placeholder for a service to "listen to all available IPs". But when accessing a service from a client/browser, you need to use a real IP address.

And as stated before, the labels for Traefik Swarm services need to go into the deploy section.
