A secure, fast, and lightweight WebDAV Server, built from the official Nginx image with minimal configuration.
$ docker run -d \
--name webdav \
-p 80:80 \
-v /path/to/your/data:/media/data \
-e USERNAME=<your-username> \
-e PASSWORD=<your-password> \
baksili/webdav-server:latest
Replace /path/to/your/data
with the actual path to the directory you want to serve, and set the desired USERNAME
and PASSWORD
for authentication.
- Create a
docker-compose.yaml
file (example) with the following content:
version: '3'
services:
webdav:
image: baksili/webdav-server:latest
container_name: webdav
restart: unless-stopped
ports:
- "80:80/tcp"
volumes:
- "/path/to/your/data:/media/data"
environment:
- USERNAME=<your-username>
- PASSWORD=<your-password>
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
-
Replace
/path/to/your/data
with the actual path to the directory you want to serve. -
Set the desired
USERNAME
andPASSWORD
for authentication. -
Run the following command to start the container:
$ docker-compose up -d
or if you want to build the image yourself, docker-compose --build -d up
.
To enable SSL/TLS support, enable the port used:
ports:
- "80:80/tcp"
- "443:443/tcp"
Uncomment the VIRTUAL_HOST
and LETSENCRYPT_EMAIL
environment variables in the docker-compose.yaml
file and provide the appropriate values:
VIRTUAL_HOST
: Your domain name.LETSENCRYPT_EMAIL
: Your email address for Let's Encrypt certificate generation.
Uncomment the following line in the volumes
section to persist the generated SSL certificates:
- "./letsencrypt:/etc/letsencrypt"
The container will automatically generate and configure SSL certificates using Certbot and Let's Encrypt.
The healthcheck
section in the docker-compose.yaml
file ensures that the container is running and responsive. It sends an HTTP request to http://localhost
every 30 seconds to check the container's health.
WebDAV is an excellent choice for syncing your Zotero library across multiple devices. It offers native file storage, global access, and smooth syncing. Follow the tutorial in example/zotero.md to set up Zotero syncing with your WebDAV server.
WebDAV provides a simple and efficient way to share files and collaborate with others. By setting up a WebDAV server, you can create a centralized repository for your team to store and access files from anywhere.
Use WebDAV as a backup solution for your important files. With the ability to access your files remotely, you can ensure that your data is safe and secure, even if your local device fails.