This episode guides you through installing Traefik using four methods: binary, Docker container, Docker Compose, and Kubernetes. The main focus is on the Docker and Compose approaches, including volume mounts, network, and port binding, then performing a first run, accessing the dashboard, and verifying the logs.

The theory is now enough — it is time to actually run Traefik. Episode 3 guides you through installing Traefik using several methods, from the simplest to the most production-ready. Each method has trade-offs you need to understand before choosing.
The method we will use throughout the series is Docker Compose: fast, tidy, and representative of a setup commonly used in production. By the end of the episode, you will have Traefik running, open the dashboard, and read its first logs. This "Traefik is running" moment will be the starting point for all subsequent experiments.
traefik image with a single command. This is the most recommended approach.The current Traefik version is v3.x. Always check the official image tags on Docker Hub. We will consistently use the traefik:v3 image with the latest minor tag.
For a bare-metal server without Docker, the binary is the lightest choice:
curl -L -o traefik.tar.gz https://github.com/traefik/traefik/releases/download/v3.1.0/traefik_v3.1.0_linux_amd64.tar.gz
tar -xzf traefik.tar.gz
sudo mv traefik /usr/local/bin/
traefik versionThis single binary needs no dependencies whatsoever — that is the advantage of Go. To run it as a service on Linux, register it via systemd with ExecStart=/usr/local/bin/traefik. However, to follow this series smoothly, the Docker method is more recommended because it standardizes the environment.
The fastest way to run Traefik is a single docker run command. Note two important things: mount the configuration file and mount the Docker socket for the provider:
docker run -d \
--name traefik \
-p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
traefik:v3At a glance the container is running. But note: no entrypoint is defined, so Traefik only exposes the API on port 8080 and does not actually route HTTP. For a functional setup, define the entrypoint via the command line:
docker run -d \
--name traefik \
-p 80:80 \
-p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
traefik:v3 \
--api.insecure=true \
--entrypoints.web.address=:80 \
--providers.docker=trueNow port 80 is active as the web entrypoint and the dashboard is available on port 8080. The --api.insecure=true flag makes the dashboard accessible without authentication — fine for experiments, but never use it in production (we secure it in episodes 4 and 28).
For this series we use a more structured Compose setup. Create the docker-compose.yml file in the ~/learn-traefik directory:
services:
traefik:
image: traefik:v3
container_name: traefik
restart: unless-stopped
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik.yml:/etc/traefik/traefik.yml:ro
command:
- --api.insecure=true
- --entrypoints.web.address=:80
- --providers.docker=trueA few things to note:
:ro) as a security practice../config/traefik.yml file is mounted to /etc/traefik/traefik.yml.Create the static configuration file first, then run:
mkdir -p config
cat > config/traefik.yml <<'EOF'
api:
dashboard: true
EOF
docker compose up -d
docker compose psIf successful, the Traefik dashboard can be opened at http://localhost:8080/dashboard/. This page shows three important tabs: HTTP Routers, HTTP Services, and Middlewares. Right now the lists are empty because there are no containers with Traefik labels — a normal condition for a first installation.
The container log is the main window for monitoring Traefik:
docker logs traefik
docker logs -f traefikThe initial log will show the Traefik banner, version, and a message that the web entrypoint is actively listening on port 80. If there are configuration errors, they will appear here. Do a quick verification with curl to make sure Traefik responds:
curl -s -o /dev/null -w "%{http_code}\n" http://localhost:80Traefik returns 404 for paths that have no router — that is normal and actually indicates Traefik is alive and rejecting unknown requests. The curl command will be your debugging companion throughout the series.
Warning
The dashboard is only opened through port 8080 with api.insecure. In production, never expose the dashboard without authentication. Episode 4 will show how to secure it with a BasicAuth middleware.
Key takeaways:
api.insecure=true.curl are the main debugging tools.In episode 4 next we will cover static configuration thoroughly — YAML, TOML, CLI, and environment variable formats, their priority order, entrypoint definitions, secure API & dashboard settings, and log configuration. From here on you will leave CLI flags behind and move to tidy configuration files.