Traefik Docker

March 12, 2024 - Reading time: 2 minutes

Making directories

I'll be saving my data in ~/docker in this example

  1. Open terminal and cd docker (mkdir docker if you don't have it)
  2. mkdir traefik and cd traefik
    This will be where i save my traefik
  3. nano docker-compose.yml  [Template]
  4. CTRL + X, y and Enter # For the basicauth.users label

Replace admin:123 with a secure login
echo $(htpasswd -nb "admin" "123") | sed -e s/\\$/\\$\\$/g
Use the result from this command


Making a few more files we will need

  1. touch config.yml
  2. touch acme.json
  3. nano traefik.yml
  4. [Template] add your cloudflare email. CTRL + X, y and Enter
  5. mkdir logs

Almost done

  1. sudo docker network create proxy
  2. sudo docker compose up -d
  3. sudo docker compose logs -f (if you want to see logs)
    Now just head on over to your domain and you should see the traefik gui