How to use plugins with docker?


Is it possible to use caddy plugins when I use the docker container?

If yes, how?

See the docs on Docker Hub, there’s a section that explains how to write a Dockerfile to build with plugins. See “Adding custom Caddy modules”

This is my setup.


FROM caddy:2.7.5-builder-alpine AS builder

RUN xcaddy build \
    --with \

FROM caddy:2.7.5

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Then docker build . will make the plugged image for you.

If you run this in a compose scenario, you just point your Caddy section to the local build instead of a public image:

      context: ./caddy
      dockerfile: Dockerfile
    restart: always

In this case the Dockerfile is located like:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.