How to setup Caddy (with Docker)
Untested
Folders
Create the folder structure.
# Create main service directory
mkdir -p /home/dan/services
# Create the Caddy directories
mkdir -p /home/dan/services/caddy/{config,data}
Caddyfile
Paste the following content:
{
# uncomment the next line if you plan on using grafana and prometheus
# metrics
log {
# can also be format json
format console {
time_format iso8601
}
}
}
Docker
-
Create the Docker Compose File
Paste the following content:
-
Download and start the
caddydocker service: -
Check if Caddy was able to start successfully.
If something doesn't look right, you can inspect the logs:
bash docker compose logs -f caddy