Skip to content

Install with Docker Compose

Run gpm as a container: verify the image, mount one data volume, publish the two proxy listener ports, and keep the admin panel off the internet.

Verifying the image

Every image pushed by the release workflow (including the latest tag, which shares the same manifest digest as the version tags built alongside it) is signed keylessly with cosign via GitHub Actions OIDC: no key material to manage or leak. The signing identity is the release.yml workflow at the git ref that started the run, so it depends on how the release was made:

Release path Signing identity ends in
A merge to main mints the tag (the normal path) release.yml@refs/heads/main
A vX.Y.Z tag pushed by hand on the current head of main release.yml@refs/tags/vX.Y.Z
  • A pushed tag is released only when its commit is the head of main at the time the run fetches main. A tag on any other commit, including an older main commit, stops the run before anything is built, pushed, tagged latest or signed. If main moves on before the run starts, push the tag again on the new head, or let the next merge to main mint the release.
  • This check lives in the release.yml of the tagged commit, because a tag push runs the workflow file of that commit. A tag on a commit whose release.yml predates the check runs the older file. Restricting who may create v* tags (a tag ruleset in the repository settings) closes that path.

Verify the version you are about to deploy (X.Y.Z) against the exact identity, never a pattern. For a release minted on main:

cosign verify \
  --certificate-identity https://github.com/Rake-Pro/go-proxy-manager/.github/workflows/release.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/rake-pro/go-proxy-manager:X.Y.Z

For a release made from a pushed tag, name that exact tag:

cosign verify \
  --certificate-identity https://github.com/Rake-Pro/go-proxy-manager/.github/workflows/release.yml@refs/tags/vX.Y.Z \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/rake-pro/go-proxy-manager:X.Y.Z
  • A successful verification prints the signature payload and confirms the image was built by the release.yml workflow in this repository, not from a fork, a different workflow, or a hand-pushed image.
  • Try the main command first. An image released from a pushed tag fails it and passes the tag command for its own version only.
  • Do not widen the identity to a pattern such as refs/tags/v.*: a run started by any pushed v* tag, on any commit, signs with a matching identity, so the pattern would accept a signature for an image that was never a release of that version.

Dev builds

Every push to dev also publishes an image, for running ahead of a release:

Tag Meaning
dev-<sha> one dev build, named by its short commit hash; the app reports the same dev-<sha> under /version and in the admin shell
dev floating, the latest dev build

Dev images are built by ci.yml and are not cosign-signed; releases (X.Y.Z, X.Y, latest) stay the supported line.

Compose file

services:
  gpm:
    image: ghcr.io/rake-pro/go-proxy-manager
    restart: unless-stopped
    ports:
      - "443:443"
      - "80:80"
      - "127.0.0.1:8081:8081"     # admin: loopback only
    environment:
      GPM_LOCAL_ADMIN_USER: admin
      GPM_LOCAL_ADMIN_PASSWORD_HASH_FILE: /run/secrets/admin_hash
    volumes:
      - gpm-data:/data
    secrets:
      - admin_hash
      - cf_token                  # for ACME (optional)
    cap_drop: ["ALL"]
    security_opt: ["no-new-privileges:true"]

secrets:
  admin_hash:
    file: ./secrets/admin_hash    # from `gpm hashpw`; owner gpm, mode 0400
  cf_token:
    file: ./secrets/cf_token      # Cloudflare API token; owner gpm, mode 0400

volumes:
  gpm-data:

The admin port is plain HTTP. Passwords, session cookies and API tokens sent to 8081 are readable by anyone on the path, so they must not cross a network to it. Publish it on loopback (127.0.0.1:8081:8081, as above) or on a management address only (192.0.2.10:8081:8081), never as a bare 8081:8081, which Docker publishes on every host address. From another machine, use an SSH tunnel or the HTTPS admin hostname (Reach the admin UI through gpm itself).

First login needs no cookie setting. GPM_COOKIE_SECURE defaults to auto: the admin session cookie is issued without Secure over http://127.0.0.1:8081, and becomes Secure (with the __Host- name) automatically once the request reaches gpm over TLS, arrives through a trusted proxy sending X-Forwarded-Proto: https, or externalBaseURL is an https:// URL.

Secret files

Plain docker compose mounts file-based secrets with the host file's own owner and mode (the uid/gid/mode secret options only apply in Swarm). Give each file to the image's non-root gpm user with mode 0400, so no other account on the host can read it:

  • Create the file with that owner and mode before writing the secret: a plain shell redirect creates it world-readable first.
  • Feed the secret through stdin, never as a command-line argument: gpm hashpw with no argument reads the password from stdin, and a token pasted at a read -s prompt stays out of shell history and the process list.
img=ghcr.io/rake-pro/go-proxy-manager
uid=$(docker run --rm --entrypoint id "$img" -u)
gid=$(docker run --rm --entrypoint id "$img" -g)
mkdir -p -m 0700 secrets
for f in admin_hash cf_token; do
  sudo install -m 0400 -o "$uid" -g "$gid" /dev/null "secrets/$f"
done

read -rsp 'admin password: ' pw; echo
printf '%s\n' "$pw" | docker run --rm -i "$img" hashpw | sudo tee secrets/admin_hash >/dev/null
unset pw

read -rsp 'Cloudflare API token: ' tok; echo
printf '%s' "$tok" | sudo tee secrets/cf_token >/dev/null
unset tok

To replace a secret later, run the same printf ... | sudo tee line: it keeps the file's owner and mode. Restart gpm afterwards.

Data directory

A single volume mounted at /data:

/data/config       git-backed config repo (see reference/config/)
/data/certs        certificate store (custom certs + ACME-issued artifacts,
                   client-CA CRLs, client-CA signing keys under client-cas/,
                   and client-certificate issuance records under client-certs/)
/data/session.db   SQLite session store (pure-Go, no CGO)

The container runs as a non-root user; make sure the mounted volume is writable by it (the image's gpm user). The object model stored under /data/config is documented in the configuration reference.

client-cas/<name>.key is where a generated ClientCA's signing key lands (POST /api/client-cas/{name}/generate, or "Generate new CA" in the UI): gpm writes it at 0600 itself, so nothing has to be provisioned externally to get a working mTLS setup. A key you place here yourself (caKeyFile pointing anywhere under the cert store, for a bring-your-own CA) is the same thing by hand: give it 0600 and owner gpm. The alternative is caKeyPEM with a ${FILE:/run/secrets/...} placeholder, which keeps the key in the secret mount instead.

Either way it is a CA private key: back it up with the rest of /data/certs, and remember it is not in the git config repo, so a config-only backup does not carry it: restoring config alone gives you a ClientCA object pointing at a key that is not there. Deleting a ClientCA does not delete its key file (see ClientCA), so removing a CA for good is a config delete plus an rm here. CA generation, certificate issuance and renewal are all POSTs, so an HA follower refuses them with 503 like every other write: do them on the leader.

client-certs/<ca>.json holds the issuance records that drive the expiry warning and the renew action. They are runtime state, not config, so a config-only backup does not carry them: back them up with the rest of /data/certs, and share the cert dir between HA peers (which the HA recipe already calls for) if you want the follower to show the same list. Losing them loses only gpm's memory of what was issued: the certificates themselves keep working, and the CA keeps verifying them.

IPv6

gpm listens dual-stack out of the box: a bare :80 / :443 bind accepts IPv4 and IPv6 on the same socket, the router and every middleware are address-family agnostic, and the client IP an access list, geo rule, rate limit or X-Forwarded-For sees is whichever address the client actually used: a v6 client appears as its v6 address, not a v4 stand-in. There is no IPv6 toggle to set.

Pinning a bind to one family is still possible and is a deliberate choice: GPM_HTTPS_ADDR=0.0.0.0:443 is v4-only, GPM_HTTPS_ADDR=[::]:443 is v6 (with v4-mapped addresses, so still both on Linux unless the host has net.ipv6.bindv6only=1).

What usually blocks inbound IPv6 is Docker, not gpm. Standard Docker behaviour:

  • The daemon needs IPv6 enabled. Set "ip6tables": true and (for a user-defined bridge) "experimental": true where your Docker version still requires it in /etc/docker/daemon.json, then restart the daemon. Without ip6tables the daemon does not program v6 NAT/forwarding rules and published ports are not reachable over v6.
  • The network needs enable_ipv6. A compose network must declare it (and, on older Compose file versions, a v6 subnet):

yaml networks: edge: enable_ipv6: true ipam: config: - subnet: fd00:dead:beef::/64 # ULA is fine; a routed /64 is better

  • The container needs a real IPv6 address, not just a v4 port mapping. A published port on a v4-only network is unreachable over v6 no matter what gpm binds.
  • userland-proxy changes what the app sees. With the default "userland-proxy": true the daemon's docker-proxy relays the connection, so the container sees the proxy's address as the peer: the real client IP is lost for both families. Setting "userland-proxy": false in /etc/docker/daemon.json keeps the connection on the kernel path (iptables / ip6tables DNAT) so the original client address arrives intact.
  • Host networking is the simplest alternative. network_mode: host gives the container the host's addresses directly: no NAT, no userland proxy, real client IPs in both families, at the cost of losing port isolation (gpm then binds the host's :80/:443 and every stream port directly).

If the edge in front of gpm is an L4 load balancer rather than the client, the client IP problem is not a Docker one: turn on settings.proxyProtocol so gpm reads the real client address (of either family) out of the PROXY header.