Error while starting server "use of closed network connection"

Hello Everyone,

I'm having issues deploying Traefik on my VPS and looking for help.

Context:
I want to run Traefik as my reverse proxy to host multiple services. In that regards, i have first secured my vps by disabling ssh on public ip and enabling ssh only via Tailscale so i can ssh only from my tailnet. Additionally I also have ufw and only allow ports that are strictly necessary (80, 443 etc.).

Then i started to configure Traefik using docker compose. I have set Traefik to use cloudflare in my "certificatesResolvers".

When starting the container it get stuck on "Attaching to traefik".

[+] Running 1/0
 ✔ Container traefik  Created                                                                                                                                                                                                           0.1s
Attaching to traefik

After checking logs for the Traefik container, i can see the following:

 ERR error="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
 ERR Error while starting server error="accept tcp [::]:8080: use of closed network connection" entryPointName=traefik
 ERR error="accept tcp [::]:80: use of closed network connection" entryPointName=web
 ERR Error while starting server error="accept tcp [::]:80: use of closed network connection" entryPointName=web
 ERR error="accept tcp [::]:443: use of closed network connection" entryPointName=websecure
 ERR Error while starting server error="accept tcp [::]:443: use of closed network connection" entryPointName=websecure

Even in this state, I could reach Traefik with my server IP. To be noted however that the certificate i got was not from let's encrypt (staging) but the build in Traefik ssl certificate.

I have tried for hours, thought it could be an issue with Tailscale as it use port 80 and 443 but i'm not sure.

Did someone had this issue?

Would be grateful if you could point me in the right direction.

usually only happens when shutting down Traefik in Docker. Are you sure its not in the logs from the last shutdown?

Thank you for your help. That seem right, I removed the container and started it again and no logs. The error only appear when I stop the container.

Is it normal for docker only display the following (when running "docker compose up") ?

[+] Running 1/0
 ✔ Container traefik  Created                                                                                                                                                                                                           0.1s
Attaching to traefik

Additionally I can also access the dashboard on port 8080. The issue is that I do not get ssl cert from letsencrypt.

Usually you would use docker compose up -d and docker compose logs -f.

Check simple Traefik example.