Get rid of ports in your docker development setup with Traefik.

When using docker in your development environment, it’s very easy to get tangled up in a web of port conflicts and frustrations. One of our engineers wrote a blog post on how to overcome this burden by using Traefik.

It saves us a bunch of frustration. You can read it on [our blog](

7 thoughts on “Get rid of ports in your docker development setup with Traefik.”

  1. I‘d suggest a wildcard DNS a entry that resolves to localhost. With you don‘t have to touch your hosts file.


  2. > Add the apache.docker url to your hosts file so it points to

    Wait… so I have to add every new service I run to my local hosts file? That’s kinda lame.

  3. Thank you, I just followed your guide and applied it to a few of my services like node-red, home-assistant, etc.

    To all those asking if you have to make a host file entry each time you add a service or to every host, I avoided this by adding in the A records into my domain name hosted externally. Say my home server runs off [](, I just created an A record called []( pointing to [](
    Then you just change this line: – traefik.http.routers.apache.rule=Host(\`\`)
    This way every computer in my house can access nodered without host file changes.

    The other point I’d make is port 8080 was taken by Unifi device discovery. So I could not run it as you did in your blog. I changed – traefik.port=8080 to – traefik.port=8081 and the port above to 8081

    Hope that helps anyone else looking to do this.

  4. As a FYI, you can dump the Traefik config file also, and specify command line parameters in the docker-compose. Eg.

    image: “traefik:v2.2”
    container_name: “traefik”
    – “–api.insecure=true”
    – “–api.dashboard=true”
    – “–providers.docker=true”
    – “–providers.docker.exposedbydefault=false”


Leave a Comment