I've been trying to deploy Traefik on my Ubuntu server as a starting point for my Docker homelab, but it's been a frustrating three days of troubleshooting. I can't get Traefik to work with Docker Swarm as I've read it should. I've made multiple adjustments to my stack, but I keep running into errors, especially a '404 page not found' when testing the WhoAmI service. It's not working whether I'm running it locally or through Cloudflare DNS. I've exhausted numerous AI tools, and now I'm just hoping for some actual help. Any tips or advice would be greatly appreciated! If you need specific details, just ask. Edit: I finally got it working with Docker Compose first and then converted it to Swarm with some minor adjustments!
6 Answers
I just can’t handle Traefik anymore. It’s too convoluted for simple setups. I recommend looking into alternatives like SWAG or Caddy if you’re still struggling.
Honestly, I think Traefik is more complex than what's necessary for many homelabs, which can be a security issue. I switched to Caddy, and I find its single file configuration so much easier to manage. It simplifies setup and troubleshooting.
After two weeks of frustration trying to set this up in Docker, I finally cracked it. The learning curve was wild but the rewards are sweet! I switched from Nginx to Traefik, and it’s nice not having to juggle multiple configs for DNS with my Pi-hole integration.
Make sure you’ve enabled the Traefik API and dashboard; they are super handy for debugging. Also, take a look at those logs. They can point out any invalid rules or configuration errors. Increasing the log level to 'DEBUG' can also shed light on what's going wrong. Maybe post your Compose file for Traefik if you keep having issues?
It sounds like starting without the Swarm mode could really help. Try getting your setup working just with Docker Compose first, and once it’s stable, you can then move it to Swarm. That way, if something breaks, you’ll have a clean version to revert to. Good luck!
Thanks for that advice! I managed to get things up and running with Compose and it's been smooth sailing since. Appreciate it!
A 404 usually means Traefik is working but it can’t find your service, or your rule doesn't match. Check the Traefik logs for any errors and make sure your rules are correctly formatted. A common mistake is getting syntax wrong; sometimes it's the backticks you're missing! You could create a wildcard rule for testing just to see if that helps you out.

I can relate, organizing directory paths for Docker Swarm vs. Compose has caused me so many headaches! It’s essential to get that right. I also struggled with port forwarding correctly on my router.