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/L9Lenny/caddy-analyzer/main/install.sh | sh

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/L9Lenny/caddy-analyzer/main/install.ps1 | iex

3. Go Toolchain Installation

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

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:

# 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

5. Manual Binary Releases

Pre-built, 100% statically linked binaries without dynamic libc dependencies are available on the GitHub Releases page:

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:

[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