I am always tired of administrating servers, that’s why i’m constantly searching for easier tools. Caddy is one of them, and i easily replaced apache with it.

Whats Caddy?

Caddy is a fast HTTP Server with a lot of modern features. It comes with built-in support for letsencrypt, you don’t have to configure it manually. There are a lot of nice features, like markdown rendering, just check out the docs at caddyserver.com/docs.

How to use?

Download binaries at caddyserver.com/download or just piping in a bash script via curl https://getcaddy.com | bash. After installing to your PATH you will have the caddy command in your shell.

Place a simple Caddyfile in a directory with following contents:


Then type caddy in your commandline and visit http://localhost:1337 in your browser. You can now browse the files in that directory.

Serving websites like apache


  • caddy runs as a service (systemd)
  • caddy runs in user mode
  • one Caddyfile to configure all sites
  • caddy proxies to my webservices via subdomain

Example Webservice

Just an example server listening on port 1337, serving static content in current directory.

python -m SimpleHTTPServer 1337


We will create a user called caddy, the systemd service runs on that user. The Caddyfile will be located at /etc/caddy/Caddyfile.

# adding a user caddy and creating /home/caddy
useradd -m caddy

Create the service file at /etc/systemd/system/caddy.service, this is actually from here:

Description=Caddy Web Server

ExecStart=/usr/local/bin/caddy -agree=true -conf=/etc/caddy/Caddyfile -pidfile=/var/run/caddy/caddy.pid -log=stderr


Give execution rights to caddy and enable/start the service:

chmod 644 /etc/systemd/system/caddy.service
systemctl enable caddy.service
systemctl start caddy.service

Create the Caddyfile in /etc/caddy/Caddyfile, with contents:

foo.example.com {
  proxy /

Thats it! Run sytemctl restart caddy.service and visit foo.example.com, you will have a https encrypted webservice.