Table of Contents

Caddy Setup

Install and configure Caddy as a reverse proxy with automatic HTTPS.

Caddy automatically handles HTTPS certificates and routes traffic to your services.

Overview

Caddy is a modern web server that automatically handles HTTPS certificates using Let's Encrypt. It serves as a reverse proxy, routing traffic to your backend services while managing TLS certificates automatically.

Benefits of Caddy

Docker Setup

Create a `docker-compose.yml` with Caddy: ```yaml services:

caddy:
  image: caddy:2-alpine
  container_name: caddy
  restart: unless-stopped
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - ./Caddyfile:/etc/caddy/Caddyfile:ro
    - caddy_data:/data
    - caddy_config:/config

volumes:

caddy_data:
caddy_config:

```

The `caddy_data` volume stores TLS certificates so they persist across container restarts.

Create Caddyfile

Create a `Caddyfile` in the same directory: ``` your-domain.com {

  reverse_proxy whoami:80

} ```

Caddy will automatically:

Start Caddy

```bash docker compose up -d ```

Test HTTPS

```bash curl -I https://your-domain.com ```

You should see HTTPS response headers.

References

See Also

Last updated: 2026-06-19