Installation
1. Pick an image
| Image | What's inside | Use it when |
|---|---|---|
ghcr.io/r0gger/cpm:latest |
All-in-one: CPM and Caddy in one container, all plugins built in | You start fresh. This is the easiest option. |
ghcr.io/r0gger/cpm-app:latest |
App only: CPM without Caddy | Caddy already runs on the host (systemd) or in another container |
2a. All-in-one
docker compose up -d
Or without Compose:
docker run -d --name cpm --restart unless-stopped \
-p 80:80 -p 443:443 -p 443:443/udp -p 8080:8080 \
-v cpm_data:/data -v caddy_config:/config -v caddy_etc:/etc/caddy -v file_server:/file_server \
ghcr.io/r0gger/cpm:latest
Everything is preset: the Admin URL is http://localhost:2019, storage is File + load in /etc/caddy, and logs work out of the box.
| Volume | Contains |
|---|---|
/data |
CPM database, secret key, logs and Caddy certificates. Back this up. |
/config |
Caddy autosave.json |
/etc/caddy |
The generated Caddyfile |
/file_server |
Files for your File Servers |
2b. App only (Caddy on the host)
-
Make sure Caddy's Admin API listens on the network. Minimal
/etc/caddy/Caddyfile:{ admin 0.0.0.0:2019 } -
Give CPM (user id
65532) write access to/etc/caddy:sudo chgrp -R caddy /etc/caddy sudo chmod 2775 /etc/caddy sudo apt install acl # if setfacl is missing sudo setfacl -m u:65532:rwx /etc/caddy -
In
docker-compose.app.yml, setCPM_CADDY_ADMIN_URLto the IP of the host (notlocalhost, that is the container itself), then start:docker compose -f docker-compose.app.yml up -d
Never expose port
2019to the internet. The Admin API has no password.
2c. Without Docker
go build -o cpm ./cmd/cpm
CPM_DATA_DIR=./data CPM_CADDY_ADMIN_URL=http://localhost:2019 ./cpm
Which setup fits you?
Pick one of these. CPM and Caddy run on the same machine, so CPM can save the config as files and Caddy keeps it after a restart. If you are not sure, use Everything in one container.
| Situation | Image | Config dir | Admin URL |
|---|---|---|---|
| Everything in one container (recommended) | cpm |
/etc/caddy |
http://localhost:2019 |
| Caddy on the host, CPM in Docker | cpm-app |
/etc/caddy (bind mount) |
http://<host-ip>:2019 |
| Both in Docker | cpm-app |
shared volume on /etc/caddy |
http://caddy:2019 |
| Both on the host | binary | /etc/caddy |
http://localhost:2019 |
Caddy on another machine is not recommended. It works with cpm-app in Memory mode and the remote Admin URL, but:
- The Admin API has no password. Anyone who can reach port
2019can change your Caddy config, and that port now has to be open on your network. - CPM cannot write the config files. After a Caddy restart, Caddy is empty until you click Re-apply.
Only use it if you cannot run CPM on the Caddy machine, and limit port 2019 to the IP of CPM with a firewall.
3. First login
- Open
http://<host>:8080. - Fill in name, email, password (at least 8 characters) and language. This first account is an administrator.
- You land on Settings > Global. Check that the badge says Caddy online.
- Fill in the ACME email address and save. You are ready to add your first proxy host.
Upgrading
Get the new version and recreate the container. Your data stays as long as you keep the /data volume.
docker compose pull && docker compose up -d # when you use image: ghcr.io/r0gger/...
docker compose up -d --build # when you build from source (default docker-compose.yml)
Edit this page on GitHub · Loaded live from R0GGER/Caddy-Proxy-Manager