Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-09-22

How to Install Traefik on Windows 10

tutorials
img

Traefik is a modern and dynamic reverse proxy that effectively routes traffic to different applications, services, and containers. This guide will walk you through the steps to install Traefik on a Windows 10 system.

Prerequisites

To proceed with the installation, ensure you have the following:

  • A Windows 10 computer with administrative rights
  • Docker Desktop installed and operational

Installing Traefik

Follow these steps to set up Traefik:

docker network create traefik-net
mkdir traefik
cd traefik
version: '3' services: traefik: image: traefik command: - "--api.insecure=true" - "--providers.docker=true" - "--providers.docker.exposedbydefault=false" - "--entrypoints.web.address=:80" ports: - "80:80" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro

This docker-compose.yaml file outlines a Traefik container that exposes port 80 and configures a network for Traefik. It also dictates that Traefik should monitor Docker events by mounting the Docker socket as a volume.

docker-compose up -d

This command will download the latest Traefik image from Docker Hub and start a container based on the configuration in your docker-compose.yaml file.

  1. Launch a command prompt or PowerShell window with administrative privileges on your Windows 10 system.
  2. Execute the command below to establish a Docker network for Traefik:
  3. Create a directory named traefik on your system using this command:
  4. Navigate into the traefik directory by executing:
  5. Inside this directory, generate a new docker-compose.yaml file and insert the following code:
  6. To initiate the Traefik container, run the command below:
  7. Finally, confirm that Traefik is active by visiting http://localhost:8080 in your web browser. This will open the Traefik dashboard, displaying details about the active Traefik instance.

     

Congratulations! You have successfully set up Traefik on your Windows 10 system and can now utilize it as a reverse proxy for your applications and services.