Skip to content
Beau Barker edited this page Jul 22, 2025 · 7 revisions

WebDAV, or Web-based Distributed Authoring and Versioning, is a set of extensions to the HTTP protocol that allows users to edit and manage files on a web server.

We'll use WebDAV for Caddy.

Build Caddy with the WebDAV plugin.

Example caddy/Dockerfile:

FROM caddy:builder AS builder

RUN xcaddy build \
    --with github.com/ggicci/[email protected]

# Final lightweight image
FROM caddy:latest

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

# Copy our Caddyfile into the image
COPY Caddyfile /etc/caddy/Caddyfile

Then:

docker compose build caddy

Compose file

Add a volume to compose.yaml:

volumes:
  user_uploads:

Add to the caddy service:

services:
  caddy:
    volumes:
      - user_uploads:/uploads:rw

Caddyfile

Add to caddy/Caddyfile:

# Uploads
handle_path /uploads/* {
  route {
    root * /uploads
    webdav
  }
}

📝 Note you don't need file_browser because WebDAV itself implements GET, PUT, etc. but you may still want file_browser serve if you want regular browsers to be able to click around and download files.

Restart Caddy:

docker compose restart caddy

Quick test

curl http://localhost:8000/uploads/

You should get XML describing the files.

Copy files to the volume

docker compose cp path/to/files caddy:/uploads/
Clone this wiki locally