https://github.com/aaykacc/traefik-docker
Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.
https://github.com/aaykacc/traefik-docker
docker docker-compose lets-encrypt load-balancer reverse-proxy traefik
Last synced: about 2 months ago
JSON representation
Traefik Docker Compose setup with Let's Encrypt, Basic Auth, and HTTPS redirection.
- Host: GitHub
- URL: https://github.com/aaykacc/traefik-docker
- Owner: aaykacc
- Created: 2025-02-11T22:34:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-12T00:27:07.000Z (over 1 year ago)
- Last Synced: 2025-07-23T01:41:51.934Z (12 months ago)
- Topics: docker, docker-compose, lets-encrypt, load-balancer, reverse-proxy, traefik
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
```bash
git clone https://github.com/your-username/traefik-docker.git
cd traefik-docker
3. 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](https://doc.traefik.io/traefik/middlewares/http/basicauth/)
```bash
htpasswd -nb admin securepassword
5. 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).
4. Create the external Docker network
Run the following command to create the external Docker network:
```bash
docker network create ingress-controller
6. Start the Traefik service:
Start the Traefik service using Docker Compose:
```bash
docker-compose up -d
## Contributing
Feel free to open issues or submit pull requests for improvements.