# Caddy

> A modern web server with automatic HTTPS and a very short config format, great for small teams and simple deployments. Free notes, key concepts, resources and...

Canonical: https://www.internhack.in/roadmaps/tracks/devops/caddy
Last updated: 2026-11-28

A modern web server with automatic HTTPS and a very short config format, great for small teams and simple deployments.

Intermediate · about 4 hours · difficulty 1/5

Learn first: [How Web Servers Serve Traffic](https://www.internhack.in/roadmaps/tracks/devops/web-server-concepts)

**Caddy** is an alternative to Nginx whose headline feature is **automatic HTTPS**: point a domain at the server and Caddy obtains and renews certificates via ACME with no extra tooling.

### What to learn

- The **Caddyfile** format: a site address followed by directives, for example `reverse_proxy localhost:3000`, `file_server`, `encode gzip`, `handle_path /api/*`.
- The JSON config and admin API for dynamic configuration.
- Load balancing across multiple upstreams with health checks.
- Plugins via `xcaddy` builds (DNS challenge providers, extra auth).

### Where it fits

Excellent for side projects, internal tools and small services where fewer moving parts matters more than a huge ecosystem. Nginx remains more common in large organisations and job postings, so knowing its concepts still pays off.

### Pitfalls

Port 80 and 443 must be reachable for the default HTTP challenge, and rate limits from the CA apply if you repeatedly wipe certificate storage.

**Good enough to move on:** you can serve a site and proxy an API with automatic TLS in a Caddyfile of under ten lines.

## Key concepts

- **Caddyfile syntax**
- **Automatic HTTPS**
- **reverse_proxy and load balancing**
- **JSON config and admin API**
- **xcaddy plugins**

## Other options for this step

- [Nginx](https://www.internhack.in/roadmaps/tracks/devops/nginx): The most widely deployed web server and reverse proxy; learn its config model and the handful of directives that cover most real setups.
- [HAProxy](https://www.internhack.in/roadmaps/tracks/devops/haproxy): A high-performance TCP and HTTP load balancer known for reliability, fine-grained health checks and detailed stats.
- [Apache HTTP Server](https://www.internhack.in/roadmaps/tracks/devops/apache): The long-standing web server still common in legacy stacks, shared hosting and PHP applications.

## Mini project

Deploy two small services on one VM behind Caddy with separate subdomains, automatic certificates, and gzip compression, all in a single Caddyfile checked into git.

## Check yourself

What must be true about your DNS and firewall for Caddy's automatic HTTPS to succeed on first start?

## Free resources

- [Caddy documentation](https://caddyserver.com/docs/) (caddyserver.com)
- [Caddyfile concepts](https://caddyserver.com/docs/caddyfile/concepts) (caddyserver.com)

Previous: [Nginx](https://www.internhack.in/roadmaps/tracks/devops/nginx) · Next: [HAProxy](https://www.internhack.in/roadmaps/tracks/devops/haproxy)

## More in Web Servers and Reverse Proxies

- [How Web Servers Serve Traffic](https://www.internhack.in/roadmaps/tracks/devops/web-server-concepts)
- [Nginx](https://www.internhack.in/roadmaps/tracks/devops/nginx)
- [Caddy](https://www.internhack.in/roadmaps/tracks/devops/caddy)
- [HAProxy](https://www.internhack.in/roadmaps/tracks/devops/haproxy)
- [Apache HTTP Server](https://www.internhack.in/roadmaps/tracks/devops/apache)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [DevOps Engineer Roadmap](https://www.internhack.in/roadmaps/tracks/devops)
