-
Notifications
You must be signed in to change notification settings - Fork 0
WebDAV
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.
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
Add a volume to compose.yaml
:
volumes:
user_uploads:
Add to the caddy
service:
services:
caddy:
volumes:
- user_uploads:/uploads:rw
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 wantfile_browser serve
if you want regular browsers to be able to click around and download files.
Restart Caddy:
docker compose restart caddy
curl http://localhost:8000/uploads/
You should get XML describing the files.
docker compose cp path/to/files caddy:/uploads/