# Traefik as a service (standalone app, not started as docker compose) and swarm mode

**URL:** <https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707>\
**Category:** Traefik v3 (latest)\
**Tags:** docker-swarm\
**Created:** [October 7, 2024, 9:06am UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707 "2024-10-07T09:06:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeviC3](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DeviC3](https://community.traefik.io/u/DeviC3)\
**Post date:** [October 7, 2024, 9:06am UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707/1 "2024-10-07T09:06:24Z")

</div>

I have a Traefik working as a systemd service. Works perfect with provider docker and recognizes docker containers locally.  
But when I'm using

```auto
  swarm:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

```

a swarm mode, it not recognizes any services running in the swarm.  
I was trying with my overlay network and also bridge but nothing helps.  
Is swarm working or need something more to configure? Docs are probably incomplete in my case (I need to run traefik as a service, not with docker daemon exposed as a 80 port)

---

<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:** [October 7, 2024, 11:43am UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707/2 "2024-10-07T11:43:14Z")

</div>

Not sure how you want to connect to Docker Swarm services/containers within a Docker overlay network, without being part of it.

Especially when you want to use Traefik Docker Swarm automatic configuration discovery, which usually uses internal Docker IPs.

Why not run Traefik in Docker? What is your issue with port 80?

---

<div class="post-metadata">

**Author:** ![DeviC3](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DeviC3](https://community.traefik.io/u/DeviC3)\
**Post date:** [October 7, 2024, 12:10pm UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707/3 "2024-10-07T12:10:42Z")

</div>

Issue is not to expose port 80 as a docker daemon  
Are there any way to attach to docker swarm network from any Traefik config?

---

<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:** [October 7, 2024, 2:36pm UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707/4 "2024-10-07T14:36:25Z")

</div>

> [@DeviC3](#):
>
> Issue is not to expose port 80 as a docker daemon

Why? Because the hackers only use port 80 for break ins?

Docker is for isolation. AFAIK you can’t connect to a Docker network from outside. And Traefik `providers.swarm` does use the Docker IPs of the containers it discovers.

Luckily you can fork and modify the Traefik source code to maybe use the published IPs instead ([Github](https://github.com/traefik/traefik/tree/v3.1/pkg/provider/docker)).

---

<div class="post-metadata">

**Author:** ![DeviC3](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@DeviC3](https://community.traefik.io/u/DeviC3)\
**Post date:** [October 7, 2024, 5:06pm UTC](https://community.traefik.io/t/traefik-as-a-service-standalone-app-not-started-as-docker-compose-and-swarm-mode/24707/5 "2024-10-07T17:06:06Z")

</div>

Thanks, you've got total right, I'm passing with this idea.
