Nginx image based on Alpine Linux, with WebDAV extensions installed.
10K+
Docker Hub - Quay.io - bfren ecosystem
A very simple WebDAV file server: the files in /www, shared over HTTP so they can be browsed, downloaded and (if you allow it) uploaded and changed.
It is Nginx with:
dav-ext module for the PROPFIND and OPTIONS methods WebDAV clients use to list foldersThere is no authentication. Run it on a private network, or behind a reverse proxy that adds a login - Caddy Proxy can do this.
Share the files in ./files (read-only) on port 8080:
docker run -d --name dav -p 8080:80 -v ./files:/www quay.io/bfren/nginx-webdav
Or with Docker Compose, allowing changes:
services:
dav:
image: quay.io/bfren/nginx-webdav:7.3
environment:
- BF_NGINX_WEBDAV_METHODS=PUT DELETE MKCOL COPY MOVE
ports:
- "8080:80"
volumes:
- ./files:/www
Open http://localhost:8080 in a browser, or connect a WebDAV client to the same address.
/etc/nginx/customImages are published to Docker Hub (bfren/nginx-webdav) and Quay.io (quay.io/bfren/nginx-webdav) for linux/amd64, linux/arm/v7 and linux/arm64. There is one build, on nginx 1.30 and Alpine 3.24.
| Tag | Example | Use when |
|---|---|---|
latest | You always want the newest image | |
MAJOR | 7 | You want updates, but not breaking changes |
MINOR | 7.3 | You want fixes only - recommended |
VERSION | 7.3.0 | You want to pin this image exactly |
| Port | Purpose |
|---|---|
80 | HTTP - put a reverse proxy in front of it for SSL and a login. |
| Volume | Purpose |
|---|---|
/www | The files to share. Unlike Nginx, this is served directly - there is no public folder. |
| Variable | Values | Description | Default |
|---|---|---|---|
BF_NGINX_WEBDAV_METHODS | off, or any of PUT DELETE MKCOL COPY MOVE | The methods that change files. off makes the server read-only; PUT DELETE MKCOL COPY MOVE allows everything. | off |
BF_NGINX_WEBDAV_ACCESS | r, rw | Permissions given to everyone else on files and folders the server creates: r (readable) or rw (also writable). It does not control what clients can do - BF_NGINX_WEBDAV_METHODS does that. | r |
Nginx adds the nginx variables (access log, health check URI, …), and Alpine + S6 adds timezone and cron.
When the container starts, Nginx sets up nginx, then this image replaces the default site with a WebDAV server generated from a template (/etc/nginx/sites/localhost.conf), using the environment variables above. The nginx image's usual set-up of /www/public (creating it, adding a welcome page, setting ownership) is turned off - your files are left exactly as they are.
nginx runs as the www user (UID 1000), so:
/www (and anything in it you want to change) must be writable by UID 1000 - e.g. chown -R 1000:1000 ./files on the hostNew files and folders are owned by www, with permissions set by BF_NGINX_WEBDAV_ACCESS.
Every .conf file in /etc/nginx/custom is included inside the server block, so it can contain anything valid there - including location blocks. For example, to allow longer uploads:
# /etc/nginx/custom/timeouts.conf
client_body_timeout 300s;
Earlier versions included /etc/nginx/sites/custom.conf instead. If you mounted a file there, move it to /etc/nginx/custom/ - anything left in /etc/nginx/sites is now only included at the http level.
These come from Nginx. The health check loads http://localhost, which is the index page for /www.
FROM quay.io/bfren/nginx-webdav:7.3
COPY ./overlay /
RUN bf-install
See Nginx for the rest.
./test.nu # builds the image and runs /test
/test runs this image's tests alongside the base images' tests, and fails if tests don't execute. They check that the dav-ext module is installed, and generate the site from its template - read-only and with the write methods enabled - checking the settings and that nginx -t accepts it, including with a location block in /etc/nginx/custom.
The server is read-only - set BF_NGINX_WEBDAV_METHODS to the methods you want to allow.
The www user (UID 1000) can't write to /www - change the ownership or permissions of the folder on the host.
nginx's configuration test failed - often because of a file in /etc/nginx/custom, or a server-level file left in /etc/nginx/sites (see Custom configuration). Check docker logs.
Some clients (e.g. macOS Finder and Windows Explorer) need WebDAV locking (LOCK and UNLOCK) before they will write, and this image doesn't enable it. Use a client that doesn't need locks, such as Cyberduck or rclone, or a command-line tool such as curl.
Put a reverse proxy in front of it that handles logins, such as Caddy Proxy. Never expose this image directly to the internet.
Copyright (c) 2020-2026 bfren (unless otherwise stated)
Content type
Image
Digest
sha256:709df8b7d…
Size
30 MB
Last updated
8 minutes ago
docker pull bfren/nginx-webdav