> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/caddyserver/caddy/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with Caddy in minutes

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](/install) if you haven't installed Caddy yet.

Verify your installation:

```bash theme={null}
caddy version
```

## Serve a Static Site

<Steps>
  <Step title="Create a simple HTML file">
    Create an `index.html` file in a new directory:

    ```bash theme={null}
    mkdir mysite
    cd mysite
    echo '<h1>Hello from Caddy!</h1>' > index.html
    ```
  </Step>

  <Step title="Start Caddy">
    Run Caddy with the file server:

    ```bash theme={null}
    caddy file-server
    ```

    Your site is now available at `http://localhost:2015`
  </Step>
</Steps>

## Use a Caddyfile

For more control, create a `Caddyfile` in your site directory:

```caddyfile theme={null}
localhost

file_server
```

Then start Caddy:

```bash theme={null}
caddy run
```

<Note>
  Caddy automatically looks for a `Caddyfile` in the current directory when you run `caddy run` without specifying a config.
</Note>

## Enable Automatic HTTPS

To enable automatic HTTPS for a real domain:

```caddyfile theme={null}
example.com

file_server
```

<Warning>
  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
</Warning>

## Reverse Proxy

Here's how to proxy requests to a backend application:

```caddyfile theme={null}
localhost

reverse_proxy localhost:8080
```

This forwards all requests to your application running on port 8080.

### With Path-Based Routing

```caddyfile theme={null}
localhost

handle /api/* {
    reverse_proxy localhost:8080
}

handle {
    file_server
}
```

## Common Caddyfile Patterns

### Static Site with Compression

```caddyfile theme={null}
example.com

encode gzip
file_server
```

### SPA (Single Page Application)

```caddyfile theme={null}
example.com

root * /var/www/myapp
try_files {path} /index.html
file_server
```

### Reverse Proxy with Custom Headers

```caddyfile theme={null}
example.com

reverse_proxy localhost:3000 {
    header_up X-Real-IP {remote_host}
}
```

### Multiple Sites

```caddyfile theme={null}
site1.com {
    root * /var/www/site1
    file_server
}

site2.com {
    reverse_proxy localhost:8080
}
```

## Production Operations

<Steps>
  <Step title="Start Caddy as a service">
    Use `caddy start` to run in the background:

    ```bash theme={null}
    caddy start
    ```
  </Step>

  <Step title="Check status">
    ```bash theme={null}
    caddy list-modules
    ```
  </Step>

  <Step title="Reload configuration">
    After changing your Caddyfile:

    ```bash theme={null}
    caddy reload
    ```

    This performs a zero-downtime reload.
  </Step>

  <Step title="Stop Caddy">
    ```bash theme={null}
    caddy stop
    ```
  </Step>
</Steps>

## Using the Admin API

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

### Get current config

```bash theme={null}
curl localhost:2019/config/
```

### Load a new config

```bash theme={null}
curl localhost:2019/load \
  -H "Content-Type: application/json" \
  -d @config.json
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book" href="/concepts/architecture">
    Learn about Caddy's architecture and module system
  </Card>

  <Card title="Caddyfile" icon="file-code" href="/config/caddyfile">
    Master the Caddyfile configuration format
  </Card>

  <Card title="Reverse Proxy" icon="arrow-right-arrow-left" href="/guides/reverse-proxy">
    Deep dive into reverse proxy configuration
  </Card>

  <Card title="CLI Reference" icon="terminal" href="/cli/run">
    Explore all Caddy commands
  </Card>
</CardGroup>
