Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Traefik v2 setup with customized security settings.

  • All traffic from port 80 is routed to port 443
  • Dashboard is SSL secured by default and not accessible in port 8080
  • Supports Docker Swarm mode


  1. clone the repo
  2. create .env file from .env.example
  • The default user and password for the dashboard is admin/admin. make sure to generate a new password using 'htpasswd' and replace it in your '.env' file
  1. create your conf/traefik.toml file from conf/conf.d/traefik.toml.example
  2. create your conf/certificates.toml file from conf/conf.d/certificates.toml.example
  3. create your conf/tls.toml file from conf/tls.toml.example
  4. place certificate and private key files in certs folder
  5. create your docker-compose.yml from
  • to create a file for docker swarm run:
docker-compose config >

Network settings:

Network name is 'proxy'

When you create a stack make sure it's divided into three networks: proxy, backend and frontend. the idea behind splitting the stack into three networks is to block the access of the reverse proxy to the backend containers.

with the Traefik container you will only create the 'proxy' network, other networks will be created with each stack according to that stack name to avoid access between frontend/backend containers of different stacks.

  • proxy
  • stack1_frontend
  • stack1_backend
  • stack2_frontend
  • stack2_backend

and so on...

  • request --> traefik --> frontend1 --> backend1
  • request --> traefik --> frontend2 --> backend2

there is a '' script included that will connect your Traefik container to all of your frontend networks. you only need to run it after creating a new stack. the connection is persistent and will remain between reboots and up/down commands. you can run the script multiple times, it will output an error if the connection already exist.

Author: RaveMaker.


docker-compose for Traefik2 reverse proxy with Swarm support.



No releases published


No packages published