DEV Community

Alex Spinov
Alex Spinov

Posted on

Caddy Has a Free Web Server — Automatic HTTPS, Reverse Proxy, and Zero-Config TLS

Nginx config for HTTPS is 20+ lines and requires certbot setup. Apache is worse. Caddy does it in 2 lines:

example.com
reverse_proxy localhost:3000
Enter fullscreen mode Exit fullscreen mode

That's it. Caddy automatically gets a Let's Encrypt certificate, renews it, and serves your app over HTTPS. No certbot. No cron jobs. No config reload.

What You Get Free

Apache 2.0 licensed:

  • Automatic HTTPS — provisions and renews TLS certificates automatically
  • Reverse proxy — route traffic to backend services
  • Static file server — serve files with one command
  • HTTP/3 — QUIC protocol support
  • Load balancing — round-robin, least-conn, IP-hash, random
  • Rate limiting — protect endpoints from abuse
  • Caddyfile — simple, readable config format
  • JSON config — API-driven configuration
  • Plugins — extend with community modules
  • Multi-platform — Linux, macOS, Windows, Docker

Quick Start

# Install
apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update && apt install caddy

# Or Docker
docker run -d -p 80:80 -p 443:443 -v caddy_data:/data caddy
Enter fullscreen mode Exit fullscreen mode
# Caddyfile — reverse proxy with automatic HTTPS
myapp.example.com {
    reverse_proxy localhost:3000
}

api.example.com {
    reverse_proxy localhost:8080
}

docs.example.com {
    root * /var/www/docs
    file_server
}
Enter fullscreen mode Exit fullscreen mode

caddy run — three domains, three backends, all with HTTPS. Zero certificate management.

What You Can Build

1. HTTPS reverse proxy — expose local services with automatic TLS.
2. Static site hostingcaddy file-server serves files with HTTPS instantly.
3. API gateway — route, rate-limit, and load-balance API traffic.
4. Multi-site server — host 50 sites on one server with automatic SSL for each.
5. Development proxy — local HTTPS for development (caddy trust).

Caddy vs Nginx vs Traefik

Nginx: Most flexible, largest ecosystem. Manual HTTPS setup.
Traefik: Auto-discovery for Docker/K8s. Overkill for simple setups.
Caddy: Simplest config, best default security. Perfect for 1-20 sites.


Need web server setup? Email spinov001@gmail.com

More free tiers: 80+ Free APIs Every Developer Should Bookmark

Top comments (0)