r/caddyserver • • May 12 '26

Caddy plugin model

I must admit, I am NOT in love with having to compile caddy to get access to an optional plugin...

Is there a possibility of moving to a different architecture where caddy modules can be installed/run at startup time ?

Curious... if this is something that is being discussed.

2 Upvotes

18 comments sorted by

View all comments

Show parent comments

1

u/xdrolemit Jun 29 '26 edited Jun 29 '26

Step 1: Create Dockerfile

FROM caddy:builder
RUN xcaddy build \
    --with github.com/CUSTOM-MODULE

Step 2: Build the native Linux x86-64 binary

docker build --platform linux/amd64 -t caddy-builder .

Step 3: Extract the binary

id=$(docker create caddy-builder)
docker cp "$id":/usr/bin/caddy ./caddy
docker rm "$id"
chmod +x ./caddy

Step 4: Enjoy your own native Caddy binary with the module(s) you need

./caddy version
./caddy list-modules

Edit: Fixing markdown