This article may contain affiliate links — the CloudPicked team selects services we genuinely recommend. Read our disclosure policy.
CloudPicked
Traefik Reverse Proxy Guide 2026
VPS & Docker Guide

Traefik Guide 2026: Automatic SSL Reverse Proxy on VPS with Docker Compose

If you've ever had to edit nginx.conf, run nginx -s reload, and manually set up certbot every time you add a new service to your VPS, Traefik will fundamentally change how you work. Traefik is a cloud-native reverse proxy that auto-configures itself from Docker labels, automatically obtains SSL certificates from Let's Encrypt, and routes traffic to containers without ever needing a restart.

This guide walks through setting up Traefik v3.8 on your VPS from scratch — covering installation, automatic SSL, real Docker Compose examples, middleware configuration, the dashboard, and troubleshooting common issues.

What Is Traefik?

Traefik (pronounced "Traffic") is an open-source reverse proxy and load balancer built specifically for cloud-native infrastructure. Unlike Nginx or HAProxy which require static configuration, Traefik automatically detects new services by reading Docker labels, Kubernetes annotations, Consul catalogs, or other provider metadata.

Traefik is running in production across billions of container instances worldwide. The latest stable release is v3.8.0 (November 2026), which added HTTP/3 support, per-router timeouts, and fixed several important CVEs.

Traefik vs Nginx Proxy Manager vs Nginx — Comparison

FeatureTraefik v3Nginx Proxy ManagerNginx (direct)
Auto-config from DockerYes (labels)No (GUI)No (config file)
SSL auto-renewYes (built-in ACME)Yes (certbot)Manual certbot
Restart to add serviceNeverNo (via GUI)Reload needed
HTTP/3 supportYes (v3+)Extra setupExtra setup
Middleware (rate limit, auth)Full suiteLimitedPlugins required
Built-in dashboardYesYes (GUI)No
Kubernetes supportExcellent (native)NoIngress nginx
Best forDevelopers / DevOpsGeneral usersAdvanced users

Data as of November 2026 — verify latest details at the provider's website.

Prerequisites

Before installing Traefik, make sure you have:

Need a VPS? AsiaGB Cloud offers Linux VPS with full Docker support and Thai datacenter locations. DigitalOcean and Bangmod Cloud are also solid options.

Directory Structure

~/traefik/
├── docker-compose.yml      # Traefik container definition
├── traefik.yml             # static configuration
├── config/
│   └── dynamic.yml         # dynamic config (optional)
└── letsencrypt/
    └── acme.json           # SSL certs store (chmod 600 required)

Static Configuration: traefik.yml

Create ~/traefik/traefik.yml:

api:
  dashboard: true
  insecure: false   # never expose dashboard on port 8080

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https
          permanent: true
  websecure:
    address: ":443"
    http3: {}   # enable HTTP/3 (QUIC) — Traefik v3+ only

certificatesResolvers:
  letsencrypt:
    acme:
      email: [email protected]   # your real email
      storage: /letsencrypt/acme.json
      tlsChallenge: {}

providers:
  docker:
    exposedByDefault: false   # explicit opt-in per service
  file:
    filename: /config/dynamic.yml
    watch: true

log:
  level: INFO   # change to DEBUG for troubleshooting

docker-compose.yml for Traefik

version: '3.8'

services:
  traefik:
    image: traefik:v3.8
    container_name: traefik
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.yml:/traefik.yml:ro
      - ./config:/config:ro
      - ./letsencrypt:/letsencrypt
    networks:
      - traefik-public
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.dashboard.rule=Host(`traefik.yourdomain.com`)"
      - "traefik.http.routers.dashboard.service=api@internal"
      - "traefik.http.routers.dashboard.entrypoints=websecure"
      - "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
      - "traefik.http.routers.dashboard.middlewares=auth"
      - "traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$YOURHASH"

networks:
  traefik-public:
    external: true

Step-by-Step Launch

# 1. Create the shared Docker network
docker network create traefik-public

# 2. Create acme.json with strict permissions (required)
mkdir -p ~/traefik/letsencrypt
touch ~/traefik/letsencrypt/acme.json
chmod 600 ~/traefik/letsencrypt/acme.json

# 3. Create config directory
mkdir -p ~/traefik/config

# 4. Generate a htpasswd hash for the dashboard
docker run --rm httpd:2.4-alpine htpasswd -nb admin YOUR_PASSWORD

# 5. Start Traefik
cd ~/traefik
docker compose up -d traefik

# 6. Watch logs
docker compose logs -f traefik

Adding Services with Docker Labels

Once Traefik is running, adding any web application is done entirely through Docker labels — no touching the Traefik config:

services:
  myapp:
    image: nginx:alpine
    networks:
      - traefik-public
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.myapp.rule=Host(`myapp.yourdomain.com`)"
      - "traefik.http.routers.myapp.entrypoints=websecure"
      - "traefik.http.routers.myapp.tls.certresolver=letsencrypt"
      - "traefik.http.services.myapp.loadbalancer.server.port=80"

networks:
  traefik-public:
    external: true

Run docker compose up -d myapp — Traefik detects the new service immediately, obtains an SSL certificate within 1–2 minutes, and starts routing HTTPS traffic. No Traefik restart needed.

Useful Middleware

Rate Limiting

labels:
  - "traefik.http.middlewares.ratelimit.ratelimit.average=100"
  - "traefik.http.middlewares.ratelimit.ratelimit.burst=50"
  - "traefik.http.middlewares.ratelimit.ratelimit.period=1m"
  - "traefik.http.routers.myapp.middlewares=ratelimit"

Basic Authentication

# Generate hash (note: $ must be escaped as $$ in docker-compose)
docker run --rm httpd:2.4-alpine htpasswd -nb admin mypassword

labels:
  - "traefik.http.middlewares.auth.basicauth.users=admin:$$apr1$$HASH"
  - "traefik.http.routers.myapp.middlewares=auth"

IP Allowlist

labels:
  - "traefik.http.middlewares.ipallow.ipallowlist.sourcerange=192.168.1.0/24,203.0.113.1/32"
  - "traefik.http.routers.myapp.middlewares=ipallow"

Security Headers

labels:
  - "traefik.http.middlewares.secure-headers.headers.stsSeconds=31536000"
  - "traefik.http.middlewares.secure-headers.headers.stsIncludeSubdomains=true"
  - "traefik.http.middlewares.secure-headers.headers.contentTypeNosniff=true"
  - "traefik.http.middlewares.secure-headers.headers.browserXssFilter=true"
  - "traefik.http.routers.myapp.middlewares=secure-headers"

Stacking Multiple Middlewares

labels:
  - "traefik.http.routers.myapp.middlewares=auth,ratelimit,secure-headers"

Real-World Stack: WordPress + Ghost + Portainer

version: '3.8'

services:
  wordpress:
    image: wordpress:latest
    networks: [traefik-public]
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wp
      WORDPRESS_DB_USER: wpuser
      WORDPRESS_DB_PASSWORD: secret
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.wp.rule=Host(`blog.yourdomain.com`)"
      - "traefik.http.routers.wp.entrypoints=websecure"
      - "traefik.http.routers.wp.tls.certresolver=letsencrypt"
      - "traefik.http.services.wp.loadbalancer.server.port=80"

  ghost:
    image: ghost:5-alpine
    networks: [traefik-public]
    environment:
      url: https://news.yourdomain.com
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ghost.rule=Host(`news.yourdomain.com`)"
      - "traefik.http.routers.ghost.entrypoints=websecure"
      - "traefik.http.routers.ghost.tls.certresolver=letsencrypt"
      - "traefik.http.services.ghost.loadbalancer.server.port=2368"

  portainer:
    image: portainer/portainer-ce:latest
    networks: [traefik-public]
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.portainer.rule=Host(`portainer.yourdomain.com`)"
      - "traefik.http.routers.portainer.entrypoints=websecure"
      - "traefik.http.routers.portainer.tls.certresolver=letsencrypt"
      - "traefik.http.services.portainer.loadbalancer.server.port=9000"

networks:
  traefik-public:
    external: true

volumes:
  portainer_data:

The Traefik Dashboard

Traefik includes a built-in web dashboard showing real-time data:

Access the dashboard at https://traefik.yourdomain.com/dashboard/ (the trailing slash is required). Log in with the credentials you configured in the Basic Auth middleware.

Production Tips

Troubleshooting

SSL Certificate Not Issuing

404 on All Routes

Dashboard Won't Open

Bottom Line: Who Should Use Traefik?

Traefik is the best choice for developers and DevOps engineers running multiple Docker containers on a single VPS. The auto-detection and auto-SSL workflow eliminates the manual overhead of Nginx + certbot. Version v3.8 is stable, ships with HTTP/3, and has had its critical CVEs patched. Recommended for anyone managing Docker workloads on a VPS.

Need a VPS to run Traefik? Start with a Linux VPS that supports full Docker deployment.

View AsiaGB Cloud VPS

Frequently Asked Questions

How is Traefik different from Nginx?

Traefik auto-configures itself through Docker labels — no need to reload or edit config files when adding new services. Nginx requires manual config edits and a reload for every new service or certificate change.

Does Traefik support automatic Let's Encrypt SSL?

Yes. Traefik has native ACME support. It automatically obtains and renews Let's Encrypt certificates before they expire, with no cron job or manual intervention required.

What is the latest version of Traefik?

The latest stable release is v3.8.0 (November 2026), which added HTTP/3 support, Kubernetes Gateway API ListenerSet, per-router timeouts, and fixed several CVEs.

Is Traefik free to use?

Yes. Traefik Community Edition is completely free and open source under the MIT license. Traefik Enterprise is a paid commercial product for large organizations needing enterprise support and additional features.

What VPS specs do I need?

Traefik is very lightweight (written in Go). A minimum of 1 vCPU + 512 MB RAM is enough for multiple services. For production workloads, 1 vCPU + 1 GB RAM is recommended.

Can Traefik be used with Kubernetes?

Yes. Traefik v3 natively supports Kubernetes Ingress Controller and the Kubernetes Gateway API — in fact, Kubernetes support is one of Traefik's headline features.