selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Traefik logo

Self-host Traefik

v3.7.19

Cloud-native reverse proxy with automatic service discovery

ReleaseOpen SourceMIT
Updated2 days ago
LanguageGo
Setup difficultyModerate
Stars
65 556
Ports
80 (HTTP entrypoint (web)), 8080 (Dashboard/API (insecure mode)), 443 (HTTPS entrypoint (websecure))
Docker
traefik
Install with Docker
Traefik dashboard showing routing overviewTraefik dashboard HTTP routers section showing Docker provider routes

What is Traefik?

Traefik is a reverse proxy and load balancer designed for microservice deployments. It connects to orchestrators such as Docker and Kubernetes to automatically detect services and generate routing rules on the fly. Core capabilities include automatic HTTPS via Let's Encrypt with wildcard certificates, multiple load balancing strategies, circuit breakers, a web dashboard, WebSocket/HTTP/2/gRPC support, metrics export to Prometheus and other systems, structured access logs, and a REST API. It runs as a single Go binary or Docker image. Configuration uses static files or CLI flags plus dynamic provider data. The project is actively maintained with frequent releases following semantic versioning.

Traefik alternatives

All self-hosted alternatives to Apigee → All self-hosted alternatives to Gravitee → All self-hosted alternatives to Kong →

Should you self-host Traefik?

Traefik scores 86/100 on selfhost.directory (how scoring works) and ranks #1 of 23 in Reverse Proxy. It has 65 556 GitHub stars, +389 in the last 30 days.

It shipped 40 stable releases in the past year. The latest, v3.7.19, came out on 12 November 2026.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Go.

Its closest alternative on selfhost.directory is Kong (81/100, 44 381 stars). Traefik scores higher overall. See Traefik vs Kong side by side.

Features

  • Access logging
  • Automatic HTTPS with Let's Encrypt
  • Automatic service discovery
  • Canary deployments
  • Circuit breakers and retries
  • Dynamic configuration reload
  • GitOps-native declarative configuration
  • Load Balancing
  • Metrics export
  • Middleware system
  • Plugin Ecosystem
  • REST API
  • Single Binary Deployment
  • Web Dashboard
  • WebSocket, HTTP/2, gRPC support

Traefik README

Traefik

Docs License Join the community support forum at https://community.traefik.io/ Twitter

Traefik (pronounced traffic) is a modern HTTP reverse proxy and load balancer that makes deploying microservices easy. Traefik integrates with your existing infrastructure components (Docker, Swarm mode, Kubernetes, Consul, Etcd, Rancher v2, Amazon ECS, ...) and configures itself automatically and dynamically. Pointing Traefik at your orchestrator should be the only configuration step you need.

How to install Traefik

Install Traefik with Docker

Docker

docker run -d
-p 80:80
-p 8080:8080
-v $PWD/traefik.yml:/etc/traefik/traefik.yml
-v /var/run/docker.sock:/var/run/docker.sock
traefik:v3.7

Official Docker image on Docker Hub

Traefik releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

How can I make Traefik return 503 instead of 404 for unmatched routes?

Create a catchall router with the lowest priority that routes to a service with no servers, which will return 503 for all unmatched requests.

Why does Let's Encrypt wildcard certificate renewal with DNS challenge fail?

This can be due to CNAME support issues. Try disabling CNAME support with the LEGO_DISABLE_CNAME_SUPPORT=true environment variable.

Why are some resources (routers, middlewares, services) not created or applied?

Check the logs for errors. If a resource is dropped after dynamic configuration evaluation, an error in the logs will indicate what went wrong.

What does the 'field not found' error mean?

This error occurs when an unknown property is encountered in the static or dynamic configuration. Validate your config with the JSON Schema for static or dynamic configuration.

Why is my TLS certificate not reloaded when its contents change?

With the file provider, configuration updates only trigger when watched files are modified. If certificate contents change without the config file changing, you must force a reload (e.g., using touch on the config file).

What are the default forwarded headers when proxying HTTP requests?

By default, Traefik adds X-Forwarded-For, X-Real-Ip, X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Proto, and X-Forwarded-Server headers.

Why does Traefik return 503 Service Unavailable?

Traefik returns 503 when a router matches but there are no healthy servers available to handle the request.

Why does Traefik return 502 Bad Gateway?

Traefik returns 502 when an error occurs while contacting the upstream service.

Why is Traefik answering 404 Not Found?

Traefik returns 404 when a request reaches an entrypoint with no matching routers, or when no HTTP/HTTPS router can match the request. This is because Traefik's routing is dynamic and it cannot assume a missing route is temporary.

More in Reverse Proxy

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…