A CLI tool to manage local reverse proxies using Caddy server. This tool makes it easy to:
- Add and remove proxy configurations
- Manage SSL certificates
- Monitor proxy status
- View and manage logs
- Backup and restore configurations
Currently supports: macOS and Linux
Windows support: Coming soon
- Node.js >= 18.0.0
- Caddy server installed
- macOS:
brew install caddy - Linux: See Caddy installation guide
- macOS:
- mkcert installed for custom certificates
- macOS:
brew install mkcert - Linux:
sudo apt install mkcert(Ubuntu/Debian) orsudo dnf install mkcert(Fedora)
- macOS:
# Install globally
npm install -g caddy-proxy-manager
# Or install locally
npm install caddy-proxy-manager# Add a proxy with Caddy's automatic HTTPS (default)
cpm add example.test 3000
# Add a proxy with mkcert-generated certificates
cpm add example.test 3000 --custom-cert# Add or update certificate for an existing domain (uses mkcert by default)
cpm cert example.test
# Add or update with specific certificate files
cpm cert example.test --cert /path/to/cert.pem --key /path/to/key.pemcpm rm example.test# List all proxies
cpm ls
# List with health check
cpm ls --healthcpm ports# View global logs
cpm logs
# View domain-specific logs
cpm logs example.test
# Follow logs in real-time
cpm logs -f
# Show last N lines
cpm logs -n 100
# Enable domain-specific logging
cpm logs:enable example.test
# Disable domain-specific logging
cpm logs:disable example.test# Backup to default file (cpm-backup.yml)
cpm backup
# Backup to custom file
cpm backup -o my-backup.yml
# Restore from default file
cpm restore
# Restore from custom file
cpm restore -f my-backup.yml# Add multiple proxies from a YAML file
cpm bulk -f proxies.ymlExample proxies.yml:
proxies:
- domain: app1.test
port: 3000
useCustomCert: true
- domain: app2.test
port: 3001
useCustomCert: false# Start Caddy server
cpm start
# Stop Caddy server
cpm stop
# Check server status
cpm status# Generate and install shell completion
cpm completion
# Generate without installing
cpm completion --no-install# Clone the repository
git clone https://github.com/dwekat/caddy-proxy-manager.git
cd caddy-proxy-manager
# Install dependencies
npm install
# Run in development mode
npm run dev
# Run linter
npm run lint
# Format code
npm run format
# Run tests
npm testMIT
