Learning Caddy - Pre-Requisite Skills & Environment Setup
Episode 0 of 31

Learning Caddy - Pre-Requisite Skills & Environment Setup

Before touching Caddy, you need to master web server concepts, HTTP/HTTPS, DNS, and TLS. In this episode you'll also prepare a Linux environment, install Caddy, and verify the first installation with basic commands.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

Welcome to the Learning Caddy series! This series will take you to mastery of Caddy — the modern web server that handles HTTPS automatically — from conceptual foundations all the way to production readiness. There are 31 episodes in total, arranged across ten phases.

But before you ever run caddy run, there are some basic skills and software you must have. Why are these pre-requisites important? Because Caddy replaces the job of Apache or NGINX with much simpler configuration, and its HTTPS automation depends on your understanding of DNS, ports, and TLS certificates. If these concepts aren't clear, the entire series will feel confusing.

This Episode 0 is your roadmap: we'll make sure you have the basic skills, prepare a Linux environment, install Caddy, and run the first verification. Once this episode is done, you'll be able to follow the rest of the series comfortably.

Essential Basic Skills

Web Server and HTTP/HTTPS Concepts

Caddy is a web server, so first understand what a web server is: a program that receives HTTP requests from browsers and sends back responses. You must understand the difference between HTTP and HTTPS, URL structure, request methods such as GET and POST, and status codes like 200, 301, and 404. Without these, reading access logs will feel like reading a foreign language.

DNS and Basic Networking

The key concepts you need to understand:

  • DNS: how domain names like example.com are translated into IP addresses.
  • Port: the communication gateway on a server; HTTP uses port 80 and HTTPS uses port 443.
  • TLS/SSL: the encryption protocol that makes HTTPS secure; Caddy handles this automatically.

Caddy uses domain addresses to decide which site to serve. So you must understand how A records work and why ports 80 and 443 need to be open in the firewall.

Basic CLI and Linux

Caddy is a single binary operated from the terminal. Get familiar with basic Linux commands like ls, cd, sudo, systemctl, and curl. An editor such as VS Code will be very helpful for writing the Caddyfile.

Check the basic environment
uname -a
cat /etc/os-release
id

The output of uname -a tells you the architecture and kernel, /etc/os-release tells you the distro, and id shows the currently active user. All three matter because Caddy is best run as a regular user, not root.

Software and Tools to Prepare

Installing Caddy via the Official Repository

The easiest way on Debian and Ubuntu is through the official Cloudsmith repository:

Add the Caddy repository
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

The curl -1sLf ... commands fetch the signing key and repository list, then sudo apt install caddy installs the latest stable Caddy version.

Supporting Tools: Docker, Git, OpenSSL, and cURL

Also prepare the supporting tools you'll use in the upcoming episodes:

Verify supporting tools
docker --version
git --version
openssl version
curl --version
  • Docker is used in episode 27 to run Caddy inside a container.
  • Git for Caddyfile version control, covered in episode 30.
  • OpenSSL to test TLS certificates manually.
  • cURL to test HTTP responses from sites served by Caddy.

Hardware and Network Requirements

Caddy is very lightweight because it's written in Go. At minimum you need:

  • 512 MB of RAM, 2 GB or more recommended.
  • 5 GB of free storage.
  • A single-core CPU, dual-core recommended.
  • An internet connection and open ports 80 and 443.

If you want to experience real automatic HTTPS, also prepare a domain name with DNS access. Without a domain, Caddy still works for localhost and IP addresses, just without public certificates.

Verifying the Installation

Check the Version and First Run

After installation finishes, verify that the Caddy binary is ready to use:

Check the Caddy version
caddy version
caddy list-modules

caddy version shows the v2.x version. caddy list-modules lists all modules compiled into your binary — a feature we'll cover in episode 29.

Your First Caddyfile

Create your first file in your home directory:

Caddyfile hello world
localhost {
    respond "Hello from Caddy!"
}

Then run Caddy in foreground mode so it's easy to stop:

Run Caddy
caddy run --config ~/Caddyfile

Once Caddy is running, open http://localhost in your browser or use curl http://localhost — both should show the text Hello from Caddy!. To stop it, press Ctrl+C.

Summary of What to Prepare

Here's a recap of the pre-requisites you prepared in episode 0:

  • Web server concepts: HTTP/HTTPS, DNS, ports, and TLS/SSL.
  • Basic Linux CLI and a text editor for writing the Caddyfile.
  • Caddy v2 installed from the official repository.
  • Supporting tools: Docker, Git, OpenSSL, and cURL.
  • Hardware and network that meet the requirements for automatic HTTPS.

If anything is still missing, stop here and complete it before moving on. A strong foundation will make the next 30 episodes feel much lighter.

Conclusion

In this episode 0 you prepared the footing for the entire series: understanding web server, DNS, and TLS concepts, setting up a Linux environment, installing Caddy v2 from the official repository, and verifying the first installation with a Caddyfile hello world.

Key takeaways:

  • Caddy is a modern web server with automatic HTTPS, operated from the CLI.
  • Master HTTP, DNS, port, and TLS concepts before writing a Caddyfile.
  • Install Caddy from the official repository so updates are easy.
  • Caddy is started with caddy run and stopped with Ctrl+C.
  • Prepare a domain with DNS access if you want real automatic HTTPS.
  • caddy list-modules shows the modules available in your binary.

In the next episode, episode 1, we'll discuss the history, background, and why you need Caddy — from the evolution of traditional web servers, the birth of Caddy by Matt Holt in 2015, to comparisons of Caddy with NGINX, Apache, and Traefik. Make sure your environment is ready, because the Learning Caddy journey has only just begun!