Skip to content

Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.

Notifications You must be signed in to change notification settings

aaykacc/traefik-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Traefik Docker Compose Setup

This repository provides a Docker Compose setup for Traefik, a modern reverse proxy and load balancer. It includes:

  • Automatic HTTPS with Let's Encrypt.
  • Secure access to the Traefik Dashboard with Basic Authentication.
  • HTTP to HTTPS redirection.

Prerequisites

  • Docker and Docker Compose installed.
  • A domain name (e.g., example.com) pointed to your server's IP address.

Setup

  1. Clone this repository:

    git clone https://github.com/your-username/traefik-docker.git
    cd traefik-docker
    
  2. Generate Basic Authentication
    The Traefik Dashboard is protected with Basic Authentication. To generate a new username and password hash, use the following command:

    Note: When used in docker-compose.yml, all dollar signs ($) in the hash need to be doubled ($$) for escaping. More details

    htpasswd -nb admin securepassword
    
  3. Update the docker-compose.yml file:

  • Replace your email for Let's Encrypt.
  • Replace your domain for the Traefik Dashboard.
  • Replace the Basic Auth hash with your own (use htpasswd to generate it).
  1. Create the external Docker network
    Run the following command to create the external Docker network:

    docker network create ingress-controller
    
  2. Start the Traefik service:
    Start the Traefik service using Docker Compose:

    docker-compose up -d
    

Contributing

Feel free to open issues or submit pull requests for improvements.

About

Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published