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
- Run the configuration wizard:
rclone config
- Follow the prompts:
- Type
n
to create a new remote. - Name the remote (e.g.
Nextcloud
). - Select
WebDAV
as the storage type. - Enter the WebDAV URL for Nextcloud:
https://nextcloud.example.com/remote.php/dav/files/<username>/
- Provide your Nextcloud username and password.
- If you are asked for additional information, enter the default value.
- Save the configuration and quit.
- Type
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.
- Create a script:
nano ~/mount_nextcloud.sh
- Add:
#!/bin/bash
rclone mount Nextcloud:/ /home/<user>/Nextcloud --daemon --vfs-cache-mode full --vfs-cache-max-age 12h
- Save and make it executable:
chmod +x ~/mount_nextcloud.sh
- Add to crontab for startup:
crontab -e
- Add:
@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.