6.0 KiB
Docker Deployment Guide
CaddyProxyManager+ is designed for Docker-first deployment, making it easy for home users to run Caddy without learning Caddyfile syntax.
Quick Start
# Clone the repository
git clone https://github.com/Wikid82/CaddyProxyManagerPlus.git
cd CaddyProxyManagerPlus
# Start the stack
docker-compose up -d
# Access the UI
open http://localhost:8080
Architecture
CaddyProxyManager+ runs as a single container that includes:
- Caddy Server: The reverse proxy engine (ports 80/443).
- CPM+ Backend: The Go API that manages Caddy via its API.
- CPM+ Frontend: The React web interface (port 8080).
This unified architecture simplifies deployment, updates, and data management.
┌──────────────────────────────────────────┐
│ Container (cpmp) │
│ │
│ ┌──────────┐ API ┌──────────────┐ │
│ │ Caddy │◄──:2019──┤ CPM+ App │ │
│ │ (Proxy) │ │ (Manager) │ │
│ └────┬─────┘ └──────┬───────┘ │
│ │ │ │
└───────┼───────────────────────┼──────────┘
│ :80, :443 │ :8080
▼ ▼
Internet Web UI
Configuration
Volumes
Persist your data by mounting these volumes:
| Host Path | Container Path | Description |
|---|---|---|
./data |
/app/data |
Critical. Stores the SQLite database (cpm.db) and application logs. |
./caddy_data |
/data |
Critical. Stores Caddy's SSL certificates and keys. |
./caddy_config |
/config |
Stores Caddy's autosave configuration. |
Environment Variables
Configure the application via docker-compose.yml:
| Variable | Default | Description |
|---|---|---|
CPM_ENV |
production |
Set to development for verbose logging. |
CPM_HTTP_PORT |
8080 |
Port for the Web UI. |
CPM_DB_PATH |
/app/data/cpm.db |
Path to the SQLite database. |
CPM_CADDY_ADMIN_API |
http://localhost:2019 |
Internal URL for Caddy API. |
NAS Deployment Guides
Synology (Container Manager / Docker)
- Prepare Folders: Create a folder
docker/cpmpand subfoldersdata,caddy_data, andcaddy_config. - Download Image: Search for
ghcr.io/wikid82/cpmpin the Registry and download thelatesttag. - Launch Container:
- Network: Use
Hostmode (recommended for Caddy to see real client IPs) OR bridge mode mapping ports80:80,443:443, and8080:8080. - Volume Settings:
/docker/cpmp/data->/app/data/docker/cpmp/caddy_data->/data/docker/cpmp/caddy_config->/config
- Environment: Add
CPM_ENV=production.
- Network: Use
- Finish: Start the container and access
http://YOUR_NAS_IP:8080.
Unraid
- Community Apps: (Coming Soon) Search for "CaddyProxyManagerPlus".
- Manual Install:
- Click Add Container.
- Name: CaddyProxyManagerPlus
- Repository:
ghcr.io/wikid82/cpmp:latest - Network Type: Bridge
- WebUI:
http://[IP]:[PORT:8080] - Port mappings:
- Container Port:
80-> Host Port:80 - Container Port:
443-> Host Port:443 - Container Port:
8080-> Host Port:8080
- Container Port:
- Paths:
/mnt/user/appdata/cpmp/data->/app/data/mnt/user/appdata/cpmp/caddy_data->/data/mnt/user/appdata/cpmp/caddy_config->/config
- Apply: Click Done to pull and start.
Troubleshooting
App can't reach Caddy
Symptom: "Caddy unreachable" errors in logs
Solution: Since both run in the same container, this usually means Caddy failed to start. Check logs:
docker-compose logs app
Certificates not working
Symptom: HTTP works but HTTPS fails
Check:
- Port 80/443 are accessible from the internet
- DNS points to your server
- Caddy logs:
docker-compose logs app | grep -i acme
Config changes not applied
Symptom: Changes in UI don't affect routing
Debug:
# View current Caddy config
curl http://localhost:2019/config/ | jq
# Check CPM+ logs
docker-compose logs app
# Manual config reload
curl -X POST http://localhost:8080/api/v1/caddy/reload
Updating
Pull the latest images and restart:
docker-compose pull
docker-compose up -d
For specific versions:
# Edit docker-compose.yml to pin version
image: ghcr.io/wikid82/caddyproxymanagerplus:v1.0.0
docker-compose up -d
Building from Source
# Build multi-arch images
docker buildx build --platform linux/amd64,linux/arm64 -t caddyproxymanager-plus:local .
# Or use Make
make docker-build
Security Considerations
- Caddy admin API: Keep port 2019 internal (not exposed in production compose)
- Management UI: Add authentication (Issue #7) before exposing to internet
- Certificates: Caddy stores private keys in
caddy_data- protect this volume - Database: SQLite file contains all config - backup regularly
Integration with Existing Caddy
If you already have Caddy running, you can point CPM+ to it:
environment:
- CPM_CADDY_ADMIN_API=http://your-caddy-host:2019
Warning: CPM+ will replace Caddy's entire configuration. Backup first!
Performance Tuning
For high-traffic deployments:
# docker-compose.yml
services:
app:
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
Next Steps
- Configure your first proxy host via UI
- Enable automatic HTTPS (happens automatically)
- Add authentication (Issue #7)
- Integrate CrowdSec (Issue #15)