Install
One compose file and two generated secrets. Everything else is entered in the browser. A host with no route to the internet installs from the release’s air-gap bundle instead: see installing without internet access.
Installation
Section titled “Installation”-
Clone the deploy repository into a directory named
caddy-proxy-manager:Terminal window git clone https://github.com/CaddyProxyManager/deploy.git caddy-proxy-managercd caddy-proxy-managerKeep that name. Compose names the project after the directory and the volumes after the project, so a different directory is a different, empty installation.
It holds
docker-compose.yml,.env.exampleand the few files they mount, one commit per release, with the images pinned to that release, so what you deploy stays on it until you pull. The managed CrowdSec container is included too, but stays off until you turn it on.Without git, download
caddy-proxy-manager-<version>-deploy.tar.gzfrom the latest release instead and unpack it into that directory: it holds the same files.The deploy repository has four release channels:
Branch Releases Database mainStable Bundled PostgreSQL nextStable and prereleases Bundled PostgreSQL nodbStable External PostgreSQL; no bundled server nodb-nextStable and prereleases External PostgreSQL; no bundled server The clone starts on
main. To choose another channel, switch branches before continuing, for examplegit switch nodborgit switch nodb-next. -
Generate
SESSION_SECRETin.env:Terminal window echo "SESSION_SECRET=$(openssl rand -base64 32)" >> .envOn
mainandnext, also generate the bundled database password:Terminal window echo "POSTGRES_PASSWORD=$(openssl rand -base64 32)" >> .envOn
nodbandnodb-next, configure an external PostgreSQL server instead:Terminal window echo 'POSTGRES_HOST=db.example.com' >> .envecho "POSTGRES_PASSWORD=$(openssl rand -base64 32)" >> .envReplace the host with your server address. The default port, user, and database are
5432,cpm, andcpm; setPOSTGRES_PORT,POSTGRES_USER,POSTGRES_DB, andPOSTGRES_SSLto override them. These branches require an external PostgreSQL server; SQLite is not supported in production. Compose refuses to start without the host and password. Finish withchmod 600 .envto keep credentials private.SESSION_SECRETis also the key every secret in the database is encrypted under: DNS provider credentials, imported private keys, agent secrets. It cannot live in the thing it encrypts, so generate it once and keep it. To rotate it, put the old value inSESSION_SECRET_PREVIOUSfor one restart, which re-encrypts everything under the new one; changing it without that makes them unreadable. A backup is sealed with a passphrase instead, so it restores onto an instance with a different one. -
Start it:
Terminal window docker compose up -dOn
mainandnext, this also starts thepostgresservice the app keeps its data in. Onnodbandnodb-next, the app connects to the external PostgreSQL server you configured.Caddy itself does not start yet. It sits behind a compose profile, and the agent starts it once the two are paired. An unpaired host answering 80 and 443 with a default page would be worse than one not listening at all.
-
Open
http://localhost:3000and follow first run. Every URL redirects there until setup is finished; there is no administrator to sign in as until you create one.
Configure it in the browser
Section titled “Configure it in the browser”Everything else is a field on the first run setup page, and afterwards on
Settings: the base URL, OAuth, analytics, GeoIP, the dashboard host. Those values are stored in the
database rather than in a file, encrypted at rest where they are secrets, and they win over
anything .env says.
Prefer that over writing variables by hand. Setup makes you sign in before the rest of the
configuration is entered, so a mistyped password shows up immediately rather than at the end. It
shows the exact OAuth callback URL to register, which is derived and hard to guess. A credential
saved there reaches docker compose in the environment of the command the agent runs, instead of
sitting in plaintext on the host for as long as the file exists.
.env.example is the reference for everything else: every variable that exists, what it defaults
to, and whether Settings owns it. Read it when you need something setup does not cover: a
PostgreSQL server other than the bundled one, a larger connection pool, a private CA for the agent,
a deployment with no agent at all. Append the one line you need; there is no reason to carry the
rest.
| Port | What |
|---|---|
| 3000 | The dashboard and API. Published so you always have a way in |
| 80 / 443 | Caddy, once it is running |
| 2019 | Caddy’s admin API. Bound only on the internal caddy-admin network, which web and the agent share and nothing can publish |
Upgrading
Section titled “Upgrading”Pull, then restart on the images the new compose file names:
git pulldocker compose pulldocker compose up -dmain and nodb carry stable releases only. Use next or nodb-next to follow prereleases too;
every release is also a tag, so git checkout v3.6.1 pins one.
Settings reports when a newer release is published to the registry you pull from. It can be switched off; the only other requests the app makes to the internet on its own are the CRS plugin registry check and the GeoIP downloads, each with a switch of its own.
Your own changes
Section titled “Your own changes”Put them in docker-compose.override.yml beside docker-compose.yml, never in the tracked files.
Compose merges it over the base file, the agent applies it when it starts Caddy, and git ignores it
along with .env, so git pull never stops on a conflict.
services: web: ports: !override - "127.0.0.1:3000:3000"From an archive install
Section titled “From an archive install”An install unpacked from a release archive becomes a clone in place, keeping its directory and so its data. Fetch first, and diff your compose file against the release you are on to find what you changed:
git init -b maingit remote add origin https://github.com/CaddyProxyManager/deploy.gitgit fetch origin --tagsgit show v3.6.1:docker-compose.yml | diff - docker-compose.yml # your releaseMove every difference into docker-compose.override.yml, then take the repository’s files:
git checkout -f -B main origin/maindocker compose pulldocker compose up -d.env and the override are untouched: neither is tracked. Every release from 3.0.0 on is a tag.
From ghcr.io/silentspud
Section titled “From ghcr.io/silentspud”Up to 3.6.1 the images were published as ghcr.io/silentspud/caddy-proxy-manager/{web,caddy,agent};
later releases are ghcr.io/caddyproxymanager/{web,caddy,agent}. The old images stay where they
are, so nothing stops working. An install older than 3.6.1 is never told about a newer release,
though, because it checks the old namespace. Moving to the deploy repository, as above, changes every image name at
once.
From PostgreSQL 17
Section titled “From PostgreSQL 17”The bundled database went from PostgreSQL 17 to 18 during the 3.0 release candidates. PostgreSQL
does not read another major version’s data files, so this one upgrade is a dump and restore rather
than a pull. It applies if your docker-compose.yml still says image: postgres:17-alpine.
Nothing is lost by getting the order wrong. The 18 service refuses to start on a volume that still
holds a 17 cluster: it restarts with an error naming the version, and the data stays where it was.
If you already updated the compose file, put the two old lines back for the first step:
image: postgres:17-alpine, and the volume mounted at /var/lib/postgresql/data.
-
With the old compose file, stop the app and dump its database from the 17 server:
Terminal window docker compose stop webdocker compose exec postgres sh -c 'pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" --format=custom --file=/tmp/cpm.dump'docker compose cp postgres:/tmp/cpm.dump ./cpm.dumpThe dump is copied out rather than redirected to a file, so it arrives intact from any shell. PowerShell’s
>, for one, re-encodes what passes through it. Keepcpm.dumpuntil you have signed in afterwards. -
Unpack the new release’s archive over the old files, then remove the containers and the 17 volume:
Terminal window docker compose downdocker volume rm caddy-proxy-manager_postgres-datadownwithout-vleaves every other volume alone, certificates included. The database volume is named after the Compose project, which is the directory the compose file is in unlessCOMPOSE_PROJECT_NAMEsays otherwise;docker volume lsshows it. -
Start PostgreSQL 18, restore into it, and bring the rest back:
Terminal window docker compose up -d --wait postgresdocker compose cp ./cpm.dump postgres:/tmp/cpm.dumpdocker compose exec postgres sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" --exit-on-error /tmp/cpm.dump && rm /tmp/cpm.dump'docker compose up -dAccounts, hosts, certificates and settings come back as they were, and you sign in with the same password. Migrations that already ran are recorded in the dump, so none of them run again.
A server you run yourself (POSTGRES_HOST) is unaffected: the app supports 17 and 18 alike, and
when to upgrade it is yours to decide.
Keeping your configuration in git
Section titled “Keeping your configuration in git”.env and docker-compose.override.yml are deliberately untracked by the deploy repository, so
your changes never conflict with a release. To version them anyway, make the deploy repository a
submodule of a repository of your own. A parent repository cannot track a file inside a submodule,
so the override lives in the parent, and COMPOSE_FILE tells Compose and the agent where:
my-config/ your repository├── docker-compose.override.yml tracked here└── caddy-proxy-manager/ the deploy repository, as a submodule ├── .env ignored by the submodule, never tracked └── docker-compose.yml-
Add the submodule under the same directory name as a clone, since the name is the project’s:
Terminal window git submodule add -b main https://github.com/CaddyProxyManager/deploy.git caddy-proxy-manager -
Create
.envinsidecaddy-proxy-manager/as in installation, and add the list of compose files to it:Terminal window echo "COMPOSE_FILE=docker-compose.yml:../docker-compose.override.yml" >> caddy-proxy-manager/.envCompose reads it from
.envin place of looking for an override besidedocker-compose.yml. On a Windows host, separate the two with;instead. -
Let the agent see the parent. It recreates Caddy from the same list, resolved against its own mount of the project, where
../leads outside the mount. Mount the parent and point the agent at the project inside it, in the override itself:docker-compose.override.yml services:agent:environment:COMPOSE_DIR: /config/caddy-proxy-managervolumes:- ..:/config:roWithout this the agent logs that it cannot find the override and recreates Caddy without your changes. A directory rather than the file alone: a single-file mount keeps the file an editor replaced on save, not the new one. The agent can read the whole parent, so keep nothing there it should not. An agent older than this release ignores
COMPOSE_FILE. -
Run
docker composefromcaddy-proxy-manager/, where.envis.
Commit .env to neither repository in plaintext. SESSION_SECRET decrypts every secret in the
database, and without it those cannot be recovered, so keep it in a password manager or encrypt it
into the parent with sops or git-crypt. Only SESSION_SECRET and POSTGRES_PASSWORD need to be
secret; anything else can sit in the override’s environment: blocks, though most settings live in
the database by now.
To upgrade, move the submodule to the newest release and commit the new pointer, which records in your history which release each change ran on:
git submodule update --remote caddy-proxy-managergit commit -am "Caddy Proxy Manager $(git -C caddy-proxy-manager describe --tags)"cd caddy-proxy-managerdocker compose pulldocker compose up -dOn a new machine, git clone --recurse-submodules, then recreate .env: it is in no repository.
The legacy method
Section titled “The legacy method”Before 3.0 the configuration lived in .env, and installing meant copying the whole reference over
and editing it:
cp .env.example .envIt still works. Resolution order is stored value → .env → built-in default, so a variable set
there is honoured and still beats the default. Once the same setting is saved in the app, the
stored value wins and the line can be deleted.
A new install rarely needs it. Most settings live in the database, so a copied .env.example is
mostly commented-out lines that duplicate what the setup page asks for anyway, and every secret
written into it is a plaintext copy the Settings path would not have made. Use it when you
provision unattended and no browser can reach the setup page: setting both ADMIN_USERNAME and
ADMIN_PASSWORD seeds an administrator at startup and skips the flow entirely.