Why I use caddy

I’ve used pretty much every popular web server out there.

Apache 1, Apache 2, nginx, and most recently OpenLiteSpeed, and currently Caddy v2.

Why do I choose caddy? Certainly it’s less popular and some would argue less capable than say nginx or apache2.

First, and this is a big one: easy configuration. If you choose to go the Caddyfile route instead of the JSON one (why wouldn’t you?) configuration is straightforward.

For instance let’s look at my configuration for caddy for this website: {
     import cert
     encode * gzip {
        gzip 9
     php_fastcgi unix//run/php/php7.4-fpm.sock
     root * /var/www/html

In that 10 lines, I setup up a snippet to set up DNS based Let’s Encrypt cerificates, gzip encoding for everything, FastCGI, static file handling, HTTP/2 push to browser, and website location.

If I wanted to do that with OpenLiteSpeed or nginx, it would take edits to the main server file, the virtual host file, and a few modules to even accomplish most of that.

OpenLiteSpeed for one is extremely difficult to get PHP + WordPress working correctly. I learned this the hard way recently.

Next, there’s automatic HTTPS: no extra modules, no messing with cerificates. It just works. And if you want to get fancy or you’re behind a CDN such as Cloudflare, you can get a build of caddy with your preferred DNS provider set up, meaning no more manually messing with DNS records yourself: Caddy does that.

Next, it’s got everything in one package: no more installing nginx-mod-blablabla just to get SSL or whatever. It’s already there, and if it’s not in just two commands and a few minutes you can have your own build of caddy.

It gets better. Caddy is also written in Go, a language known for it being memory safe and extremely fast and lightweight.

To give you an idea, with Apache2 my sites Time To First Byte (TTFB) is around 1800ms, and nginx/OpenLiteSpeed about 1500ms. With caddy? 600ms. In addition, my site really flies!

In addition, the default file manager/directory lister is clean looking and mobile friendly. Now that’s something none of the others can claim!

Caddy may not be as mature, but in my experience, it’s just unbeatable.

To top