Mount a WebDAV share on an Unraid server
Mounting a WebDAV share on your personal Unraid server can be a challenge, especially since Unraid does not natively support it. While there is a rclone plugin that allows you to mount WebDAV shares, there are other solutions that can also work.
One approach I found was to use a Docker container image that makes it easy to connect to a WebDAV and mount the folder to my host system (Unraid). Since I run most of my applications in Docker containers, this solution worked well for me. With this setup, I can access the WebDAV share from other containers on my Unraid server and backup my data, for example.
The specific Docker image that I used for this solution is efrecon/webdav-client. Here's an example of a docker-compose file that can be used to create the container:
version: "3"
services:
webdav-client:
container_name: webdav-client
image: efrecon/webdav-client
environment:
- WEBDRIVE_USERNAME=username
- WEBDRIVE_PASSWORD=password
- WEBDRIVE_URL=https://webdav.yourdomain.com
- DAVFS2_ASK_AUTH=0
devices:
- /dev/fuse
cap_add:
- SYS_ADMIN
security_opt:
- "apparmor=unconfined"
volumes:
- /mnt/user/webdav:/mnt/webdrive:rshared
restart: always
This docker-compose file specifies the necessary configuration parameters for the efrecon/webdav-client image. These parameters include the username and password for the WebDAV server, the WebDAV URL, and the mount point on the host system. With these parameters set, the container can be started and the WebDAV share mounted.
If you are using an Unraid server, Docker Compose may not be readily available. Instead, you can achieve the same functionality using a docker run
command. Here's the equivalent docker run
command that replicates the Docker Compose configuration:
docker run -d \
--name=webdav-client \
--env WEBDRIVE_USERNAME=username \
--env WEBDRIVE_PASSWORD=password \
--env WEBDRIVE_URL=https://webdav.yourdomain.com \
--env DAVFS2_ASK_AUTH=0 \
--device=/dev/fuse \
--cap-add=SYS_ADMIN \
--security-opt="apparmor=unconfined" \
--volume=/mnt/user/webdav:/mnt/webdrive:rshared \
--restart=always \
efrecon/webdav-client