Installation Guide
Complete cross-platform installation methods and system integration
1. Linux & macOS One-Line Installer
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/lenny-ts/caddy-analyzer/main/install.sh | bash
2. Windows PowerShell One-Line Installer
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/lenny-ts/caddy-analyzer/main/install.ps1 | iex
3. Go Toolchain Installation
If you have Go 1.25+ installed, compile and install directly from source code using the Go toolchain:
ℹ Prerequisite
Requires Go 1.25+ installed on your system. Check withgo version. Download from go.dev/dl if needed.
go install github.com/lenny-ts/caddy-analyzer/cmd/caddy-analyze@latest
4. Docker Container Setup
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:
⚠ Security
Mounting/var/run/docker.sock gives the container root-equivalent access to the Docker daemon. Only do this in trusted environments — the container can start, stop, and inspect all other containers.
# Run static log file analysis docker run --rm -v /var/log/caddy:/logs ghcr.io/lenny-ts/caddy-analyzer /logs/access.log # Stream from Docker daemon socket docker run --rm -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/lenny-ts/caddy-analyzer docker://my-caddy
5. Manual Binary Releases
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-bit
6. Systemd Service Guard Integration
To 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:
⚠ Root required
The systemd service runsguard as root (required for iptables). Ensure the ExecStart path points to the installed binary (/usr/local/bin/caddy-analyze).
[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
7. Verify Installation
After installing via any method above, verify the binary is on your PATH and working:
caddy-analyze --version
✓ Tip
Ifcommand not found appears after installation:
- Linux/macOS: Ensure
/usr/local/binor$GOPATH/binis in your$PATH. For Go installs:export PATH=$PATH:$(go env GOPATH)/bin - Windows: Restart your terminal to pick up the new PATH entry, or run
refreshenvif using Chocolatey. - Docker: No installation needed — just use
docker runcommands directly.