Skip to main content
Get Caddy up and running in minutes with this quick start guide. You’ll learn how to serve static files and set up a reverse proxy with automatic HTTPS.

Prerequisites

Before you begin, make sure you have Caddy installed. See the installation guide if you haven’t installed Caddy yet. Verify your installation:

Serve a Static Site

1

Create a simple HTML file

Create an index.html file in a new directory:
2

Start Caddy

Run Caddy with the file server:
Your site is now available at http://localhost:2015

Use a Caddyfile

For more control, create a Caddyfile in your site directory:
Then start Caddy:
Caddy automatically looks for a Caddyfile in the current directory when you run caddy run without specifying a config.

Enable Automatic HTTPS

To enable automatic HTTPS for a real domain:
For automatic HTTPS to work:
  • You must own the domain
  • DNS must point to your server
  • Ports 80 and 443 must be open
  • Caddy must be publicly accessible

Reverse Proxy

Here’s how to proxy requests to a backend application:
This forwards all requests to your application running on port 8080.

With Path-Based Routing

Common Caddyfile Patterns

Static Site with Compression

SPA (Single Page Application)

Reverse Proxy with Custom Headers

Multiple Sites

Production Operations

1

Start Caddy as a service

Use caddy start to run in the background:
2

Check status

3

Reload configuration

After changing your Caddyfile:
This performs a zero-downtime reload.
4

Stop Caddy

Using the Admin API

Caddy’s admin API runs on localhost:2019 by default.

Get current config

Load a new config

Next Steps

Core Concepts

Learn about Caddy’s architecture and module system

Caddyfile

Master the Caddyfile configuration format

Reverse Proxy

Deep dive into reverse proxy configuration

CLI Reference

Explore all Caddy commands