The Modern Web Server
Caddy is the web server that tries to remove work rather than add capability. It asks for a domain name and takes care of obtaining a certificate, serving the site over HTTPS, and renewing that certificate before anyone notices it is close to expiry. It reads a configuration language small enough to hold in your head, and it exposes an HTTP endpoint through which the running server can be reconfigured without being restarted. What it does not do is hide the trade-offs. Behind the small language sits a full web server with a request chain, a set of ordered handlers, and a set of rules about which handler runs first, and the difference between a configuration that works and one that misbehaves is usually a matter of understanding that chain.
The course is built around that chain. The first thread is the server itself: how the binary is installed, how it is put under a supervisor, and how you confirm that it is genuinely ready to serve traffic rather than merely running. The second thread is the configuration language, because a request only goes somewhere if the routing rules put it there, and the rules have a fixed order that the language does not always make obvious. The third thread is TLS, which in Caddy is not a feature you switch on but a consequence of naming a host, and which behaves differently depending on whether the name resolves publicly, sits behind a load balancer, or is internal only. The fourth thread is the layer between Caddy and your application: proxying, load balancing, health checks, header rewriting, and streaming, which is where most production problems actually live. The fifth thread is everything around the server, namely the security baseline, the deployment in containers, the extension model, the administrative API, the command line, the logging and metrics that tell you what happened, and the habits that keep a deployment running for years rather than weeks.
The order matters, because each thread depends on the one before it. Nothing can be configured before the server is installed and verified, since the first thing you do with a running server is read back the configuration it actually loaded. Nothing about TLS can be reasoned about before routing is understood, because a certificate is only useful if requests reach the right site block. Nothing about proxying or observability can be evaluated before the security baseline and the deployment model are settled, because both determine what the server is allowed to see and where it is allowed to run. The threads are therefore cumulative rather than parallel: each one assumes the previous one.
The prerequisites are modest but not zero. You should be comfortable editing a text configuration file, running commands on a Linux or macOS command line, reading a shell script well enough to know that an environment variable is being substituted into a path, and understanding what an HTTP request and an HTTP response contain. You do not need prior experience with web servers, with TLS, or with Go. You do need to be willing to read a log file and a shell prompt as evidence rather than as noise, because most of what this course teaches is how to tell a configuration mistake apart from a network problem from an application problem, and the only way to tell them apart is to look.
By the end of the course you will be able to install and verify Caddy on a server, write a configuration that routes deliberately rather than accidentally, obtain and renew certificates for public and internal names, proxy to an application with load balancing and health checks, put the whole thing behind a sensible security baseline, deploy it in containers, extend it with a module of your own, and operate it: reloading configuration without downtime, driving it from the command line, reading its logs, and watching its metrics.
Approach:
The subject of this course is a web server, but the skill being taught is not memorising directives. It is the ability to reason about why a request ended up where it did. That requires three things in order: a server that is running and verified, a mental model of how the configuration language orders its handlers, and the operational habits that keep a deployment healthy. The teaching therefore moves from the concrete and observable to the abstract, and each stage produces something you can check rather than merely believe.
Steps:
- Establish the ground truth first, by installing the server, running it under a supervisor, and confirming through three independent checks that it is listening, that its configuration is valid, and that it answers a real HTTPS request. Every later stage depends on having a server whose behaviour can be observed.
- Learn the configuration language as a language, with its site blocks, its global options, its named matchers, and its ordered handler chain. The habit to build here is reading the adapted JSON to find out what a directive actually became, rather than guessing.
- Add TLS once routing is understood, and treat the failure modes of issuance as a debugging exercise rather than as magic, because the challenge mechanisms explain every issuance error you will meet.
- Introduce the proxy layer with its own vocabulary: upstreams, policies, active and passive health checks, header rewriting, and streaming. This is where the difference between a demo and a production deployment becomes visible.
- Then harden and package: the security baseline, the container deployment, and the extension model, each of which assumes the previous ones are already in place.
- Finish with operation: the administrative API for changing a running server, the command line for the everyday tasks, the logging and metrics that reveal what the server is doing, and the best practices that tie the whole thing together.
- At every stage, verify rather than assume, by reading the effective configuration from the running process, by checking the logs, and by making real requests. The habit of confirmation is the part that transfers to every other server you will ever run.
Answer:
A working understanding of Caddy comes down to being able to answer four questions about any configuration you meet. Which server receives the request, and how is it distinguished from the other servers on the same port? Which handler runs first, and why is that handler first rather than another one? What happens to the request after the handler returns, whether that is a file on disk, a proxied response, or a generated reply? And what evidence would tell you that any of those answers is wrong?
The first three questions are answered by the configuration and by the handler chain that the Caddyfile adapter builds from it. The fourth is answered by the logs, the metrics, and the effective configuration that the running process will give you on request. A course on Caddy is therefore not really a course on Caddy at all; it is a course in making a running system explain itself, and that is the part that keeps being useful long after the specific directives have changed.
