The automated POSIX shell script detects your operating system (Linux or macOS) and processor architecture (AMD64, ARM64 Apple Silicon/Raspberry Pi, ARMv7, 386), downloads the latest compiled release binary, and installs it to /usr/local/bin/caddy-analyze:
curl -sSfL https://raw.githubusercontent.com/L9Lenny/caddy-analyzer/main/install.sh | sh
Downloads the compiled caddy-analyze.exe binary for Windows, extracts it into %LOCALAPPDATA%\caddy-analyze, and adds the folder to your User PATH variable automatically:
iwr -useb https://raw.githubusercontent.com/L9Lenny/caddy-analyzer/main/install.ps1 | iex
If you have Go 1.22+ installed, compile and install directly from source code using the Go toolchain:
go install github.com/L9Lenny/caddy-analyzer/cmd/caddy-analyze@latest
You can run caddy-analyzer using Docker without installing Go or compiler toolchains on your host machine. Mount your host log directory into the container:
# Run static log file analysis docker run --rm -v /var/log/caddy:/logs ghcr.io/L9Lenny/caddy-analyzer /logs/access.log # Stream from Docker daemon socket docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/L9Lenny/caddy-analyzer docker://my-caddy
Pre-built, 100% statically linked binaries without dynamic libc dependencies are available on the GitHub Releases page:
caddy-analyzer_0.1.0_linux_amd64.tar.gz — Linux x86_64caddy-analyzer_0.1.0_linux_arm64.tar.gz — Linux ARM64 (Raspberry Pi 4/5, AWS Graviton)caddy-analyzer_0.1.0_darwin_arm64.tar.gz — macOS Apple Silicon (M1/M2/M3/M4)caddy-analyzer_0.1.0_darwin_amd64.tar.gz — macOS Intelcaddy-analyzer_0.1.0_windows_amd64.zip — Windows 64-bitTo run caddy-analyze guard as an automated background system service on Linux that automatically blocks attacking IPs via iptables, create /etc/systemd/system/caddy-guard.service:
[Unit] Description=caddy-analyzer Security Guard Daemon After=network.target caddy.service [Service] Type=simple ExecStart=/usr/local/bin/caddy-analyze guard --limit 50 --window 1m /var/log/caddy/access.log Restart=always RestartSec=5 [Install] WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable --now caddy-guard