Back to Blog

Docker Compose Reverse Proxy: Traefik vs Nginx Proxy Manager

Set up a reverse proxy for your homelab. Compare Traefik and Nginx Proxy Manager for automatic SSL, domain routing, and secure access to self-hosted services.

Posted by

Reverse proxy comparison

Why You Need a Reverse Proxy

A reverse proxy lets you access all your services through clean URLs (nextcloud.home.local) instead of IP:port combinations. It also handles SSL certificates automatically.

Nginx Proxy Manager (Easiest)

services:
  npm:
    image: jc21/nginx-proxy-manager:latest
    ports:
      - "80:80"
      - "443:443"
      - "81:81"  # Admin UI
    volumes:
      - ./npm/data:/data
      - ./npm/letsencrypt:/etc/letsencrypt
    restart: unless-stopped

# Access http://your-ip:81
# Default: [email protected] / changeme
  • Beautiful web UI for configuration
  • Point-and-click SSL setup
  • Perfect for beginners

Traefik (Most Powerful)

services:
  traefik:
    image: traefik:latest
    command:
      - "--api.dashboard=true"
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "[email protected]"
      - "--certificatesresolvers.letsencrypt.acme.storage=/acme.json"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik/acme.json:/acme.json

  whoami:
    image: traefik/whoami
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`test.yourdomain.com`)"
  • Auto-discovers Docker containers
  • Configuration via labels
  • More flexible but steeper learning curve

Recommendation

Beginners: Start with Nginx Proxy Manager
Advanced users: Traefik for automation and flexibility

Continue Reading