Quick Start
Pull the Docker Image
Pull the latest pre-built Caddy Defender image from GitHub Container Registry:This image includes Caddy with the Defender plugin pre-installed and all standard IP ranges embedded.
Prepare Your Caddyfile
Create a Save this file to a known location on your host system, such as
Caddyfile with your Defender configuration. For example:/path/to/Caddyfile.Run the Container
Start the container with proper volume mounts and port mappings:Key parameters:
-d: Run in detached mode--name caddy: Container name for easy reference-v /path/to/Caddyfile:/etc/caddy/Caddyfile: Mount your Caddyfile-p 80:80 -p 443:443: Expose HTTP and HTTPS ports
Volume Mounts
Caddyfile Configuration
The Caddyfile must be mounted at/etc/caddy/Caddyfile:
Data Directory (Optional)
For persistent TLS certificates and other Caddy data:Config Directory (Optional)
For additional configuration files:Port Mappings
By default, Caddy uses port 80 for HTTP and port 443 for HTTPS. Both should be mapped to your host.
Docker Compose
For easier management, use Docker Compose:Advanced Configuration
Running with Custom Network
Updating the Container
Troubleshooting
Port Already in Use
If you see an error about ports being in use:Permission Denied on Volume Mount
Ensure your Caddyfile has proper permissions:Configuration Errors
Test your Caddyfile before running:Next Steps
Configuration
Learn how to configure the Defender plugin
Examples
See real-world configuration examples