Skip to content
Runbook

Install Caddy on macOS

Modern web server with automatic HTTPS, usable as a reverse proxy and file server.

Toolweb-serverreverse-proxyhttpstlshttp

Installation

Caddy (Homebrew) · Homebrew
brew install caddy

Installs the single caddy binary.

Verify the installation

Verify
caddy version

Service

Start
brew services start caddy
Stop
brew services stop caddy
Status
brew services info caddy
Restart
brew services restart caddy

Important files

TypePathDescription
config/opt/homebrew/etc/CaddyfileDefault Caddyfile used by the Homebrew service (Apple Silicon; /usr/local/etc on Intel).

Default ports

80443

Command-line tools

  • caddyServer and CLI: caddy run, caddy reload, caddy file-server, caddy reverse-proxy.

Uninstall

Uninstall
brew services stop caddy
brew uninstall caddy

Good to know

  • Binding ports 80/443 requires elevated privileges; for local testing, use a site address like localhost which Caddy serves over HTTPS with a local CA.
  • Edit /opt/homebrew/etc/Caddyfile, then apply changes with caddy reload (or restart the brew service).
  • For a one-off static server in the current directory, run caddy file-server --listen :8080.

Installation with Homebrew

brew install caddy installs the single caddy binary. Run it as a background service with brew services start caddy, which reads /opt/homebrew/etc/Caddyfile (Apple Silicon; /usr/local/etc on Intel).

Local HTTPS

For development, a site address of localhost makes Caddy serve HTTPS using a locally trusted certificate authority it installs on first use. Public domains on ports 80/443 require those privileged ports (run with elevated rights).

Ad-hoc usage

Without any config, caddy file-server --listen :8080 serves the current directory, and caddy reverse-proxy --from localhost:8080 --to localhost:3000 spins up a quick proxy. Use caddy reload to apply Caddyfile edits without downtime.