How to automatically mount your cloud folder with WebDAV

By | January 23, 2017

In this post, I will explain how to automatically mount your cloud folder with WebDAV. I will use GMX storage as an example (https://storage-file-eu.gmx.com/).

Install the davfs2 package

sudo apt-get install davfs2

Create the mounting point. For example

mkdir -p /home/username/gmx

You can connect the via the command straight away. You will be prompted for your username and password.

sudo mount -t davfs -o uid=me,gid=me https://storage-file-eu.gmx.com/ /home/username/gmx

This isn’t entirely convenient, though; it’s better to be able to mount the directory as a normal user. Now edit /etc/fstab to setup a mount point by adding a line:

https://storage-file-eu.gmx.com/        /home/username/gmx      davfs   rw,noauto,user  0       0

Then setup the permissions of `davfs2′ to run as a non-root user.

sudo dpkg-reconfigure davfs2

Add your username to the correct group

usermod -a -G davfs2 username

Log out and in again to update the group information. Now you should be able to mount your share and work with your files.

mount /home/username/gmx
umount /home/username/gmx

Leave a Reply

Your email address will not be published. Required fields are marked *