docker.recipes

WebDAV Server

beginner

Simple WebDAV server for file access.

Overview

WebDAV (Web Distributed Authoring and Versioning) is an extension of the HTTP protocol that enables remote file management over web connections. Originally developed as RFC 4918, WebDAV transforms any HTTP server into a file server accessible through standard network protocols, allowing users to collaboratively edit and manage files stored on remote web servers. The protocol supports file locking, properties, and namespace operations, making it ideal for distributed content management and file sharing scenarios. The Bytemark WebDAV Docker image creates a lightweight, containerized file server that exposes local storage through the WebDAV protocol. This implementation uses Apache HTTP Server with mod_dav modules to provide standards-compliant WebDAV functionality, complete with Basic authentication and configurable user access controls. The container maps local Docker volumes to WebDAV-accessible directories, transforming Docker's persistent storage into network-accessible file shares. This setup particularly benefits small teams, home lab enthusiasts, and organizations needing simple file sharing without complex infrastructure. Unlike heavyweight solutions like Nextcloud or ownCloud, this WebDAV server focuses solely on file access protocols, making it perfect for automated backups, cross-platform file synchronization, and legacy application integration that requires WebDAV connectivity.

Key Features

  • Apache-based WebDAV implementation with full RFC 4918 compliance for maximum client compatibility
  • HTTP Basic authentication with configurable username/password credentials
  • Native support for WebDAV extensions including PROPFIND, PROPPATCH, MKCOL, and DELETE methods
  • File locking mechanisms to prevent concurrent edit conflicts in multi-user environments
  • Cross-platform client support including Windows Explorer, macOS Finder, and Linux davfs2
  • Lightweight footprint under 50MB with minimal resource requirements
  • Apache mod_dav integration providing robust HTTP/1.1 and WebDAV protocol handling
  • Direct volume mounting allowing existing file structures to be WebDAV-accessible immediately

Common Use Cases

  • 1Remote file access for distributed teams working with shared documents and media files
  • 2Automated backup storage for applications requiring WebDAV protocol connectivity
  • 3Legacy system integration where older software expects WebDAV file repositories
  • 4Cross-platform file synchronization between Windows, macOS, and Linux workstations
  • 5Simple file server replacement for small offices transitioning from network drives
  • 6Development environment file sharing without complex authentication systems
  • 7Home lab media storage accessible from multiple devices and operating systems

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration
  • Minimum 512MB RAM and 1GB disk space for container and file storage
  • Port 80 available on host system (or alternative port configuration)
  • WebDAV client software installed on connecting devices (built into most operating systems)
  • Basic understanding of WebDAV protocol limitations and security considerations
  • Network connectivity between WebDAV clients and Docker host system

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 webdav:
3 image: bytemark/webdav:latest
4 container_name: webdav
5 restart: unless-stopped
6 environment:
7 AUTH_TYPE: Basic
8 USERNAME: ${WEBDAV_USER}
9 PASSWORD: ${WEBDAV_PASSWORD}
10 volumes:
11 - webdav_data:/var/lib/dav
12 ports:
13 - "80:80"
14
15volumes:
16 webdav_data:

.env Template

.env
1WEBDAV_USER=admin
2WEBDAV_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://github.com/BytemarkHosting/docker-webdav
  2. 2Connect at http://localhost with WebDAV client
  3. 3Clients: Windows Explorer, macOS Finder, Cyberduck, rclone
  4. 4Mount on Linux: davfs2 (sudo mount -t davfs http://localhost /mnt)
  5. 5Mount on macOS: Finder > Go > Connect to Server
  6. 6For HTTPS: put behind reverse proxy like Caddy/Traefik

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 webdav:
5 image: bytemark/webdav:latest
6 container_name: webdav
7 restart: unless-stopped
8 environment:
9 AUTH_TYPE: Basic
10 USERNAME: ${WEBDAV_USER}
11 PASSWORD: ${WEBDAV_PASSWORD}
12 volumes:
13 - webdav_data:/var/lib/dav
14 ports:
15 - "80:80"
16
17volumes:
18 webdav_data:
19EOF
20
21# 2. Create the .env file
22cat > .env << 'EOF'
23WEBDAV_USER=admin
24WEBDAV_PASSWORD=changeme
25EOF
26
27# 3. Start the services
28docker compose up -d
29
30# 4. View logs
31docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/webdav-server/run | bash

Troubleshooting

  • HTTP 401 Unauthorized errors: Verify WEBDAV_USER and WEBDAV_PASSWORD environment variables match client credentials exactly
  • Windows Explorer connection failures: Add registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\BasicAuthLevel=2 for HTTP Basic auth
  • macOS Finder 'cannot connect' errors: Use http://username:password@localhost format in Connect to Server dialog
  • File upload failures with large files: Increase Apache LimitRequestBody directive or use chunked transfer encoding in clients
  • Permission denied on file operations: Ensure webdav_data volume has correct ownership and the container user has write access
  • Linux davfs2 mount failures: Install davfs2 package and add user to davfs2 group before mounting WebDAV shares

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space