Nextcloud VFS with Rclone on Linux as an official app alternative

The problem?

Nextcloud VFS on Linux is a mess and I couldn't get it to work on my Fedora KDE Plasma Desktop 41 device with their official app.

The solution:

Use Rclone with WebDAV as an efficient VFS.


Install Rclone

Install Rclone on your system:

  • Debian/Ubuntu:

sudo apt update && sudo apt install rclone

  • Fedora:

sudo dnf install rclone

Configure Rclone for Nextcloud

  1. Run the configuration wizard:
    1. rclone config
  2. Follow the prompts:
    1. Type n to create a new remote.
    2. Name the remote (e.g. Nextcloud).
    3. Select WebDAV as the storage type.
    4. Enter the WebDAV URL for Nextcloud:
      1. https://nextcloud.example.com/remote.php/dav/files/<username>/
    5. Provide your Nextcloud username and password.
    6. If you are asked for additional information, enter the default value.
    7. Save the configuration and quit.

Create a Mount Folder

Create a folder where your Nextcloud files will appear:

mkdir -p /home/<username>/Nextcloud

Mount the Nextcloud Drive

Mount your Nextcloud drive using:

rclone mount Nextcloud:/ /home/<username>/Nextcloud --daemon --vfs-cache-mode full --vfs-cache-max-age 12h

Automate Mounting on Startup

Optionally, you can also mount it during login.

  1. Create a script:
    1. nano ~/mount_nextcloud.sh
  2. Add:
    1. #!/bin/bash
      rclone mount Nextcloud:/ /home/<user>/Nextcloud --daemon --vfs-cache-mode full --vfs-cache-max-age 12h
  3. Save and make it executable:
    1. chmod +x ~/mount_nextcloud.sh
  4. Add to crontab for startup:
    1. crontab -e
  5. Add:
    1. @reboot /path/to/mount_nextcloud.sh

You do not have to use crontab. Many distros have their own method of executing a script at startup.

Open the folder you created in step 3. You will see all your virtual Nextcloud files there.