How to Access Your Nextcloud Files via WebDAV on Ubuntu Desktop
If you followed and finished our previous tutorial on how to set up Nextcloud on Ubuntu 16.04 VPS or dedicated server, then you might wonder “How can I access Nextcloud files from my Ubuntu/Linux computer?” Nextcloud team released a Linux client but it’s a source package. If you don’t want to manually compile Nextcloud Linux client, then you can use WebDAV instead.
WebDAV (Web-based Distributed Authoring and Versioning) is an extension of the HTTP protocol. Using WebDAV, your Nextcloud will be mounted on your Linux desktop as if it’s a network drive. It won’t take any space on your local hard drive.
Graphical Linux WebDAV Client
The Nautilus file manager integrated a WebDAV client in itself. To access your Nextcloud files from Nautilus, go to
Connect to Server.
Server Address field enter the Nextcloud WebDAV URL. davs means DAV secure. Replace red text with your actual domain name and username.
Next, enter your Nextcloud username and password. And click
Once it’s mounted, you will see a new entry for your Nextcloud on the left pane of Nautilus file manager.
Mount Nextcloud via WebDAV Protocol From the Command Line
davfs2 WebDAV file system driver.
sudo apt update sudo apt install davfs2
During the installation, you will be asked whether you want unprivileged users be allowed to mount WebDAV resources. Choose Yes.
You can always bring back this dialog later by executing the following command:
sudo dpkg-reconfigure davfs2
Next, add your user account to the
sudo gpasswd -a your-username davfs2
Re-login for the changes to take effect.
Then go to your home directory and create two directories, one to mount the Nextcloud WebDAV share, and the other to hold the WebDAV configuration.
cd mkdir nextcloud mkdir .davfs2
sudo cp /etc/davfs2/secrets ~/.davfs2/secrets
secrets file must be readable and writable by the owner only (mode 0600). So issue the following command to make yourself as the owner.
sudo chown your-username:your-username ~/.davfs2/secrets
And set 0600 as the permission mode.
sudo chmod 600 ~/.davfs2/secrets
Then open the
Add your Nextcloud login credentials to the end of the
secrets file, using your Nextcloud WebDAV URL and your Nextcloud username and password:
https://nextcloud.your-domain.com/remote.php/dav/files/nextcloud-username/ nextcloud-username password
Edit the file system table:
sudo nano /etc/fstab
Add the following line to the end of the file.
https://nextcloud.your-domain.com/remote.php/dav/files/nextcloud-username/ /home/username/nextcloud davfs user,rw,auto 0 0
After saving the file, you can mount your Nextcloud share with:
Now you can view, create, edit or delete your Nextcloud files in this directory. To unmount, run:
If your Nextcloud is installed in a sub-directory of your website, then the WebDAV URL should be
A wrong WebDAV URL will result in 500 Internal Server Error. If the mount failed, you can check out Nextcloud logs by going to your Nextcloud admin page and clicking the
You might see the following notice when mounting Nextcloud share.
/sbin/mount.davfs: warning: the server does not support locks
This tells us that Nextcloud server does not support file locking so that you want to make sure a file is not being edited from two different places at the same time, or your editing will be lost. If you don’t want to see this warning, add the following line at the end of
I hope this tutorial helped you mount Nextcloud share on your Ubuntu desktop. As always, if you found this post useful, then subscribe to our free newsletter. You can also follow us on Google+, Twitter or like our Facebook page.