Skip to content

WebDAV on Linux

Credits of this description go to Robert Östling: https://gist.github.com/robertostling/fe085016c86fa3688292010799057a1d

This describes how to mount a NextCloud drive locally on a Linux system. Tested with Debian 10 and SUNET drive through Stockholm University.

Install the necessary package, and optionally make your local user able to mount without root access:

sudo apt update sudo apt install davfs2 sudo usermod -a -G davfs2 localuser mkdir /home/localuser/mountpoint 

Login to Sunet Drive and obtain the webdav URL from Settings (the one in the lower left corner), and create an application password from user symbol (the one in the upper right corner) -> Security -> Devices & sessions. The WebDAV URL looks similar to this: https://su.drive.sunet.se/remote.php/dav/files/tene3253%40su.se/

Edit /etc/davfs2/secrets to contain the following line, using the information obtained above:

your_URL your_username your_password 

Edit /etc/davfs2/davfs2.conf and ensure that the following options are set:

use_proxy 0 use_locks 0 if_match_bug 1 

Edit /etc/fstab and append:

your_URL /home/localuser/mountpoint davfs user,noauto 0 0 

Re-login (as localuser), and mount the share:

mount /home/localuser/mountpoint