Skip to content

Repository files navigation

CPM - Caddy Proxy Manager

CPM Logo

πŸš€ Lightweight web UI for managing Caddy reverse proxy
Wildcard SSL β€’ Auto-detection β€’ One-click migration

Version Go Docker Platforms Image Size


πŸ“Έ Screenshots

CPM Dashboard
Dashboard β€” system overview, alerts, quick actions

CPM Settings
Settings β€” language, theme, wildcard SSL, users

CPM Proxy Rules
Proxy Rules β€” visual editor for reverse proxy configuration

CPM Certificates
Certificates β€” SSL overview with expiration status


✨ Features

Feature Description
πŸ“Š Dashboard System overview, stats, alerts, quick actions
πŸ”€ Proxy Rules Visual editor for reverse proxy rules
πŸ” Wildcard SSL Manage wildcard certificates with DNS challenge
βš™οΈ Snippets Cloudflare DNS, security headers, rate limiting
πŸ“œ Certificates SSL overview with expiration warnings
πŸ‘₯ Multi-User Role-based access (Admin, Editor, Viewer)
πŸ’Ύ Backup Full config backup & restore
🌐 i18n English, Czech & Korean
πŸ“‹ Templates 17+ pre-configured service templates
🐳 Docker Auto-Discovery Automatic container detection with one-click rule creation

πŸš€ Quick Start

Docker Hub

docker pull perteus/caddy-ui:3.2.0
docker pull perteus/caddy-ui:latest

Docker Compose (Recommended)

version: '3.8'

services:
  caddy:
    image: caddy:2-alpine
    container_name: caddy_proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./caddy-config:/etc/caddy
      - ./caddy-data:/data

  cpm:
    image: perteus/caddy-ui:3.2.0
    container_name: cpm
    ports:
      - "8501:8501"
    environment:
      - CONTAINER_NAME=caddy_proxy
      - DEFAULT_IP=192.168.1.100
    volumes:
      - ./caddy-config:/caddy-config
      - ./caddy-data:/caddy-data
      - /var/run/docker.sock:/var/run/docker.sock

With Cloudflare DNS Challenge (Wildcard SSL)

services:
  caddy:
    image: serfriz/caddy-cloudflare:latest
    container_name: caddy_proxy
    environment:
      - CF_API_TOKEN=${CF_API_TOKEN}
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./caddy-config:/etc/caddy
      - ./caddy-data:/data

  cpm:
    image: perteus/caddy-ui:3.2.0
    container_name: cpm
    privileged: true  # Required for Synology
    ports:
      - "8501:8501"
    environment:
      - CONTAINER_NAME=caddy_proxy
      - DEFAULT_IP=192.168.1.100
    volumes:
      - ./caddy-config:/caddy-config
      - ./caddy-data:/caddy-data
      - /var/run/docker.sock:/var/run/docker.sock

πŸ” Wildcard SSL Setup

  1. Navigate to Settings β†’ Wildcard SSL
  2. Add your domain (e.g., zrnek.cz for *.zrnek.cz)
  3. Select provider (Cloudflare) and configure API token
  4. Migrate existing sites - CPM will offer to update all matching sites

When creating new proxy rules, CPM automatically detects if a wildcard certificate is available and pre-selects it.

How it works

CPM generates TLS snippets in snippets.caddy:

(wildcard-tls-zrnek-cz) {
    tls {
        dns cloudflare {env.CF_API_TOKEN}
    }
}

Sites using wildcard import this snippet:

adguard.zrnek.cz {
    import wildcard-tls-zrnek-cz
    import cloudflare_dns
    reverse_proxy 192.168.1.100:3000
}

βš™οΈ Environment Variables

Variable Description Default
PORT HTTP port 8501
CONTAINER_NAME Caddy container name caddy
CADDY_CONFIG_PATH Path to Caddy config /caddy-config
CADDY_DATA_PATH Path to Caddy data /caddy-data
DEFAULT_IP Default target IP for new rules 192.168.1.1
CF_API_TOKEN Cloudflare API token (for wildcard SSL) -

πŸ“ Folder Structure

caddy-config/
β”œβ”€β”€ Caddyfile              # Main config (managed by CPM)
β”œβ”€β”€ snippets.caddy         # Shared snippets + wildcard TLS (auto-generated)
β”œβ”€β”€ sites/
β”‚   β”œβ”€β”€ wildcard/          # Wildcard site handle blocks
β”‚   β”‚   └── *.domain.caddy
β”‚   └── standard/          # Standard domain {} blocks
β”‚       └── domain.caddy
└── pages/                 # Custom error pages (optional)
    β”œβ”€β”€ 403.html
    └── 404.html

caddy-data/
└── caddy/
    └── certificates/      # SSL certificates (auto-managed)

πŸ”§ Synology NAS Setup

For Synology Docker, use privileged: true to allow Docker socket access:

cpm:
  image: perteus/caddy-ui:3.2.0
  privileged: true
  volumes:
    - /volume1/docker/caddy-config:/caddy-config
    - /volume1/docker/caddy-data:/caddy-data
    - /var/run/docker.sock:/var/run/docker.sock

πŸ“š API

GET  /api/v1/sites    # List all proxy rules
GET  /api/v1/status   # Caddy status
POST /api/v1/reload   # Reload Caddy configuration

πŸ—οΈ Building from Source

# Prerequisites: Go 1.26

git clone https://github.com/TomasZmek/cpm.git
cd cpm

# Build
go build -o cpm ./cmd/cpm

# Run
./cpm

Docker Build

docker build -t perteus/caddy-ui:3.2.0 --no-cache .
docker push perteus/caddy-ui:3.2.0
docker push perteus/caddy-ui:latest

πŸ“ Version History

Version Date Notes
3.3.1 2026-06-17 πŸ”’ Security patch β€” Go 1.26.4 (CVE-2026-42504, CVE-2026-27145, CVE-2026-42507)
3.3.0 2026-06-13 🌐 i18n refactor β€” PO/MO format, Korean language, plural support infrastructure
3.2.0 2026-05-31 🐳 Docker Auto-Discovery β€” automatic container detection, multi-host support
3.1.3 2026-05-30 πŸ”’ Security patch β€” x/crypto CVE fixes, moby/moby/client
3.1.2 2026-05-16 πŸ”’ Security fixes, refactoring
3.1.1 2026-05-16 πŸ”’ Security update, Go 1.26, multi-platform (amd64/arm64)
3.1.0 2026-01 πŸ” Wildcard refactor, new architecture
3.0.2 2026-01 πŸ› Wildcard TLS fix, parser fix, 405 fix
3.0.1 2026-01 πŸ” Wildcard SSL, migration tools, UI improvements
3.0.0 2026-01 πŸŽ‰ Complete Go rewrite (794MB β†’ 6MB)
2.2.1 2025-12 Python version (deprecated)

v3.2.0 - Docker Auto-Discovery

  • βœ… Auto-Discovery β€” automatic detection of running containers
  • βœ… Multi-host support β€” monitor multiple Docker hosts
  • βœ… Smart pairing β€” match existing proxy rules with containers
  • βœ… One-click rule creation β€” pre-filled from discovered containers
  • βœ… Local IP autodetection β€” detects host IP automatically

v3.1.2 - Security Fixes & Code Quality

  • βœ… Race condition fix - ValidateSession no longer writes to map under read lock
  • βœ… Path traversal fix - ZIP restore is now protected against zip-slip attacks
  • βœ… CSRF protection - all forms now protected with CSRF tokens
  • βœ… Brute-force protection - login endpoint rate limited (5 attempts / 15 min)
  • βœ… Dashboard fix - certificate days remaining now displays correctly
  • βœ… Code deduplication - shared utils package, consistent logging

v3.1.1 - Security Update & Multi-platform

  • βœ… Go 1.26 - updated runtime with security fixes
  • βœ… Multi-platform - native amd64 and arm64 support (Apple Silicon, Raspberry Pi, Synology)
  • βœ… Fiber v2.52.13 - security fixes (CVE-2025-66630, CVE-2026-25882)
  • βœ… Docker SDK v28.5.2 - updated Docker client library
  • βœ… Internal-only restrictions - restrict site access to internal network only

v3.1.0 - Wildcard Refactor

  • βœ… New architecture - Wildcard blocks in Caddyfile, handle blocks for sites
  • βœ… Correct TLS handling - No more individual certificate requests
  • βœ… Better error reporting - Detailed Caddy output in UI
  • βœ… Internal-only fix - Handled at wildcard block level

🀝 Contributing

Contributions welcome! Feel free to submit issues and pull requests.


πŸ“„ License

MIT License - see LICENSE for details.


πŸ™ Acknowledgments


CPM - Caddy Proxy Manager
Made with ❀️ for home labs
Docker Hub β€’ GitHub

About

Caddy Proxy Manager - Lightweight web UI for managing Caddy reverse proxy

Resources

Stars

71 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages