A ZeroSSL Project Store Forum GitHub Theme: System
Caddy web server Caddy web server
  • Documentation
    Install How to install Caddy on your computer or server Caddyfile A simplified, human-friendly configuration format JSON Powerful and programmable native config format
    Tutorials
    Caddy basics Static files Reverse proxy Troubleshooting
    Reference
    Command line Caddyfile API JSON Config Auto HTTPS
    Develop
    Architecture Contribute Write a module
    Articles
    Logging Monitoring Run as service Profiling All articles...
    Examples Learn from examples contributed by the community FAQ Get fast answers to common questions Modules The official list of registered Caddy plugins
    Documentation index Community wiki Contribute to docs
  • Features
  • Account
  • Support
Download Sponsor
Pages
  • Get Caddy
  • Install
  • Build from source
  • Tutorials
  • Getting Started
  • Quick-starts
    • Using the API
    • Using a Caddyfile
    • Static files
    • Reverse proxy
    • HTTPS
  • Caddy API
  • Caddyfile
  • Reference
  • Command Line
  • API
  • Caddyfile
    • Concepts
    • Global options
    • Directives
    • Request matchers
    • Response matchers
    • Common patterns
  • Modules
  • JSON Config Structure
  • Automatic HTTPS
  • Articles
  • Caddy Architecture
  • Conventions
  • Config Adapters
  • Keep Caddy Running
  • How Logging Works
  • Monitoring Caddy
  • Profiling Caddy
  • Verifying Asset Signatures
  • Troubleshooting Strategies
  • Developers
  • Extending Caddy
    • Caddyfile Support
    • Config Adapters
    • Placeholders
  • Module Namespaces

The Caddyfile

The Caddyfile is a convenient Caddy configuration format for humans. It is most people's favorite way to use Caddy because it is easy to write, easy to understand, and expressive enough for most use cases.

It looks like this:

example.com {
	root * /var/www/wordpress
	encode
	php_fastcgi unix//run/php/php-version-fpm.sock
	file_server
}

(That's a real, production-ready Caddyfile that serves WordPress with fully-managed HTTPS.)

The basic idea is that you first type the address of your site, then the features or functionality you need your site to have. View more common patterns.

Menu

  • Quick start guide

    A good place to begin getting familiar with the Caddyfile.
  • Full Caddyfile tutorial

    Learn to do a variety of common things with the Caddyfile.
  • Caddyfile concepts

    Required reading! Structure, site addresses, matchers, placeholders, and more.
  • Directives

    Keywords at the beginning of lines that enable features for your sites.
  • Request matchers

    Filter requests by using matchers with your directives.
  • Global options

    Settings that apply to the whole server rather than individual sites.
  • Common patterns

    Simple ways to do common things.

Note

The Caddyfile is just a config adapter for Caddy. It is usually preferred when manually crafting configurations by hand, but is not as expressive, flexible, or programmable as Caddy's native JSON structure. If you are automating your Caddy configurations/deployments, you may wish to use JSON with Caddy's API. (You can actually use the Caddyfile with the API too, just to a limited extent.)

On this page
Caddy web server

A free open source project that relies on sponsors.

Privacy-respecting analytics by Fathom


© 2026 ZeroSSL. All rights reserved.

Project
Features Download Documentation
Business services
Support Sponsorships
Community
Forum GitHub Twitter / X Research

Caddy supports an open Web that promotes privacy, preserves data ownership, fosters innovation, freely allows varieties of client software, and safeguards human sanctity.

014506