Introducing WebDAV
WebDAV, or Web Distributed Authoring and Versioning, is an extension of the Hypertext Transfer Protocol (HTTP) that allows users to collaboratively edit and manage files on remote web servers. Think of it as a file server accessible over the web, enabling you to create, change, and move documents directly on the server, much like a network drive. It’s widely used for synchronizing files across devices and providing remote access to document repositories.
Introducing sfuhrm/docker-nginx-webdav
The sfuhrm/docker-apache-webdav Docker image provides an incredibly secure, fast, and lightweight WebDAV server built on a minimal Alpine Linux base. This image is designed for efficiency and security, making it an excellent choice for deploying your personal or small-scale WebDAV service.
What sets this image apart?
- Tiny Footprint: At approximately 5 MB image size, with containers typically using around 12 MB of memory, it’s remarkably small and resource-efficient.
- Enhanced Security: It prioritizes security by never storing filesystem secrets directly in environment variables. Instead, it leverages Docker secrets for managing sensitive credentials.
- Robust Foundation: Built on Alpine Linux, known for its small size and security focus.
- Automated Builds: Integrates with GitHub Actions for automated daily builds, ensuring you always have access to the latest, well-maintained image.
apache httpd vs nginx
The image uses apache httpd using the dav_fs_module and dav_module.
There’s an older image I published using nginx as the web server using the mod-http-dav-ext.
Both support basic WebDav protocol coverage. Apache httpd has a much better WebDav conformance than nginx. The image / memory footprint is comparable.
Getting Started: Usage
Setting up your WebDAV server with sfuhrm/docker-apache-webdav is straightforward. You can run it directly with Docker, mapping a port and specifying a volume for your files:
Bash
$ docker run --name keepass-webdav \ -p 8080:8080 \ -v /path/to/your/keepass/files/:/media/data \ -d sfuhrm/docker-apache-webdav
Replace /path/to/your/keepass/files/ with the actual path on your host system where you want your WebDAV files to be stored.
⚠️ the docker call above sets no passwords, making the container completely open to everyone
Authentication
For secure access, you’ll want to set up authentication. The image supports passing the location of a „htpasswd“ format password file via the HTPASSWD_FILE environment variable:
$ docker run --name webdav -p 8080:8080 \
-v /path/to/your/shared/files/:/media/data \
-v /path/to/htpasswd:/etc/webdav/htpasswd:ro \
-e HTPASSWD_FILE=/etc/webdav/htpasswd \
-d sfuhrm/docker-apache-webdav
The htpasswd file can be created with a tool that comes with Apache httpd called 'htpasswd' (Debian: package apache2-utils):
htpasswd -c5 ./htpasswd username
This will create a htpasswd file with a SHA-512 hash, and interactively prompt for the password of user ‚username‘.
For a more comprehensive setup, especially with secrets, consider using the provided docker-compose.yml example in the GitHub repository. It’s also strongly recommended to place this WebDAV server behind a reverse proxy with TLS (e.g., Nginx, Caddy) to encrypt your traffic, as the image itself does not include built-in TLS support.
Contribute to the Project!
The sfuhrm/docker-apache-webdav project is open-source and thrives on community contributions. If you find this image useful, have ideas for improvements, or encounter any issues, your participation is highly encouraged! Whether it’s reporting bugs, suggesting new features, or contributing code, every bit helps make this a better tool for everyone.
Get involved on GitHub:
- Explore the code: sfuhrm/docker-apache-webdav GitHub Repository
- Submit issues or feature requests.
- Fork the repository and send pull requests.
Your contributions can help shape the future of this lightweight and secure WebDAV solution!