Skip to content

Traefik loses all bridge network connections when modifying port mappings or toggling dashboard #3313

Description

@that0n3guy

To Reproduce

  1. Have multiple Docker Compose services deployed with domains (using isolated bridge networks)
  2. Go to Web Server → Traefik settings
  3. Either:
    • Enable or disable the Traefik dashboard, OR
    • Click "Save" on "Additional Port Mappings" (even without making changes)
  4. All compose services become inaccessible (404 errors)

Additionally, when performing these actions in the UI, a "Failed to fetch" error appears in the lower right corner.

Workarounds

Option 1: Manually reconnect Traefik to all compose networks:

for net in $(docker network ls --filter "driver=bridge" --format "{{.Name}}" | grep "^saas-"); do
  docker network connect "$net" dokploy-traefik 2>/dev/null && echo "Connected: $net"
done

Option 2: Redeploy each affected compose service via the UI.

What I've already tried

  1. Ran the breaking changes fix from v0.25.7 release notes:
docker pull traefik:v3.6.1
docker stop dokploy-traefik || true
docker rm dokploy-traefik || true
docker run -d \
  --name dokploy-traefik \
  --restart always \
  -v /etc/dokploy/traefik/traefik.yml:/etc/traefik/traefik.yml \
  -v /etc/dokploy/traefik/dynamic:/etc/dokploy/traefik/dynamic \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -p 80:80/tcp \
  -p 443:443/tcp \
  -p 443:443/udp \
  traefik:v3.6.1
docker network connect dokploy-network dokploy-traefik || true
  1. Ran update script: curl -sSL https://dokploy.com/install.sh | sh -s update

Issue persists after both attempts.

Related Issues

Current vs. Expected behavior

Current: When Traefik container is recreated/restarted via the UI, it loses all bridge network connections to compose services. Only dokploy-network remains connected. Services return 404 until manually reconnected or redeployed.

Expected: Traefik should maintain (or automatically reconnect to) all compose bridge networks after restart/recreation.

Debugging

Verify missing networks:

for net in $(docker network ls --filter "driver=bridge" --format "{{.Name}}" | grep -E "^saas-|^[a-z]+-[a-z]+-[a-z0-9]{6}$"); do
  if ! docker network inspect "$net" --format '{{range .Containers}}{{.Name}} {{end}}' | grep -q "dokploy-traefik"; then
    echo "Missing traefik: $net"
  fi
done

Provide environment information

OS: ubuntu 24.04
dokploy version v0.26.2
VPS Hetzner
All these apps are docker compose deployments.
- **Traefik version:** v3.6.1

Which area(s) are affected? (Select all that apply)

Traefik

Are you deploying the applications where Dokploy is installed or on a remote server?

Same server where Dokploy is installed

Additional context

No response

Will you send a PR to fix it?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions