Expert Caddy Series
Make Caddy your superpower.
Caddy is a powerful platform for modern web services and applications. Although you can start in just a few minutes, Caddy can take years to master. Or it can take a few weeks with this masterclass.
My name is Matt Holt, and I'm the author of Caddy. I've written these exclusive book-quality chapters to help you make the most of this unique and versatile web server. You can expect to:
- become more skilled with Caddy than the average user,
- better synthesize raw documentation into useful configurations,
- maximize functionality, productivity, and profit,
- lower operating costs,
- reduce errors in production, and
- simplify your infrastructure.
We'll dive deep into Caddy's source code, craft lots of Caddy configurations, examine intermediate and advanced scenarios, extend Caddy with custom plugins/modules, discuss related topics and technologies, and unlock Caddy's true potential.
Some of the topics we'll cover are:
- Automatic HTTPS in depth
- How PKI helps us establish trust on the Internet
- The network stack
- Mutual TLS (client and server authentication)
- Basic and advanced reverse proxying
- Scaling HTTPS using On-Demand TLS
- Mastering Caddy's JSON config
- Designing the Caddy 2 architecture
- Everything you never wanted to know about the Caddyfile adapter
- Advanced TLS automation
- Running your own PKI with Caddy
- How the HTTP server works
- And much more, driven by your feedback and requests
In most cases, you can cherry-pick just the chapters you want; there's not exactly a narrative structure. However, all readers should already be quite familiar with the basics of using Caddy as per the official documentation.
I have personally always preferred written text content over videos for learning. While reading, I can go at my own pace, easily find what I'm looking for, listen to music, and think critically until I understand something. It's also way more handy for copying and pasting examples. It's jarring to constantly adjust videos to my own pace and to keep my attention so continuously. I also don't have video equipment. So, I don't plan on doing many videos—unless enough sponsors really want them! I hope you'll enjoy consuming this material in chapter form as much as I am enjoying creating it.
Please feel free to give me your feedback -- I will improve and add chapters based on your suggestions and requests.
Sponsors make open source Caddy possible. Chapters with a "Sponsor" button next to them are reserved for my open source sponsors at $25/mo. or higher. If you aren't a sponsor already, it's easy to sign up: just click the button and choose a tier at least $25/mo. Sponsoring is a great look for your company, benefits your customers, and helps sustain the open source development of the project.
If you or your company are already sponsoring at $25/mo. or higher, ask me for credentials to access. I just kindly request that you do not share or redistribute this exclusive content or your credentials. You can reach me on Twitter as @mholt6. Be sure to tell me your GitHub username.
Now then, as we begin... a big round of applause to all sponsors!
Establishing Trust On the Internet: PKI and TLS
In this bottom-up construction, we'll take an intuitive approach to explain how trusted TLS connections are established on the Internet using Public Key Infrastructure (PKI), and the most common reasons why it sometimes fails.
- Public and private keys
- Chains of trust
- PKI in private infrastructure
- Certificate lifetimes
- Verifying a certificate chain
- Interpreting verification errors
Automatic HTTPS in Depth
Explore the intricate process of enabling secure connections by default. We review how traditional HTTPS works, describe the ACME protocol, discuss principles of certificate management, and explain how Caddy ties it all together in source code.
- Traditional HTTPS
- ACME Protocol
- Certificate management
- ACME in Caddy
Mastering JSON Configuration in Caddy 2
With access to all of Caddy's configuration parameters, a JSON config offers you full control over your web server; something the Caddyfile can't do! Become familiar with the auto-generated JSON docs and how Caddy JSON works to overcome any fears of JSON configuration.
- JSON documentation
- The Four Keys
- The standard apps
- Configuring a simple app
- Editor assistance
- Config paths
Transport Layer Mastery with Caddy's Layer 4 Module
Dig under the application layer and take control of raw data streams over TCP and UDP sockets with Caddy's powerful
layer4 module. With it, you can multiplex protocols on the same port and compose expressive routes with logic based both on properties of the connection and by previewing a decoded, structured form of the data stream.
- Composing routes
- Building a
- Proxying within Caddy
- A Signal proxy
(More chapters are in the process of being written, edited, and published.)