Rclone
Overview
Rclone is a command line program to manage files on cloud storage. It is a feature rich alternative to cloud vendors' web storage interfaces. This is what is used to mount your Debrid cloud storage to your server. It is a very powerful tool and can be used to sync files, copy files, mount drives, and much more.
What you'll learn
- How to install Rclone on your server
- How to configure Rclone
- How to mount your Debrid cloud storage to your server
We will be using real-debrid and zurg for this guide. You can use any other Debrid service too.
Prerequisites
Linux
Since this guide is for Linux, you need to have a Linux server
Debrid Service
Debrid Service like real-debrid
Docker (Optional)
Required to run rclone in a containerized environment. Only required if you want to run rclone in a container
Zurg (Optional)
This guide uses zurg with real-debrid. Not required, but preferred for real-debrid users for better performance
Setup
We need to setup rclone cache folder and mount folder:
Installation
Baremetal rclone
Install rclone
It will output something like this:
If you ever use sudo with rclone, make sure to use the --config
flag to
specify the config file path or it will use the root user's config file.
Configure rclone
Open the file in your favorite text editor:
Paste the zurg webdav and http remote configurations in the file:
For other debrid services or without zurg, you can mount the webdav/ftp/ftps/sftp remote directly. You can find some examples at the end of this guide.
Setup dependencies
Make sure you have fuse3
installed:
Edit the fuse
configuration file:
Uncomment the following line:
Running rclone
Now we need to make a service file which will mount the remote:
Paste the following in the file:
Edit the ExecStart
to your preference & User
and Group
fields with your username.
If required, you can change the ExecStart
options as per your requirements. For example:
--vfs-cache-max-size=70G
- Maximum size of the cache--cache-dir=/mnt/cache
- Cache directory--vfs-cache-max-age=48h
- Max age of objects in the cache--uid=1000 --gid=1000
- User and group id. Default should be good for most users
Reload the systemd daemon:
Start the service:
Verify the service is running:
And voila! Your Debrid cloud storage is now mounted to your server. You can verify it by running ls /mnt/zurg
.
You should see some files and folders related to your Debrid service.
Docker rclone
For zurg
users
For zurg
users, you can follow the github instruction on zurg
repository.
The compose files comes with rclone
and zurg
pre-configured.
Zurg can be used with baremetal rclone too. It is not necessary to use docker rclone. See zurg documentation for more information.
For other debrid services
For other debrid services, you can use the following docker-compose file:
Make sure to replace name:
with your remote name specified in the rclone.conf
file, service-name
with your desired container name and
/mnt/destination
with the path where you want to mount the remote.
If required you can change the command
options as per your requirements. For example:
--vfs-cache-max-size=10G
- Maximum size of the cache--cache-dir=/mnt/cache
- Cache directory--vfs-cache-max-age=48h
- Max age of objects in the cache--uid=1000 --gid=1000
- User and group id. Default should be good for most users
How do i setup rclone.conf
?
One way is to run rclone config
on host and then create a new remote. Follow the instructions and set it up. Then copy the remote config to the rclone.conf
file in the same directory as docker-compose.yml
.
What we are doing here is using rclone on the host to setup the remote and then using the same config in the docker container. This way we don't have to setup the config ourselves in the container.
tldr; copying that specific remote from ~/.config/rclone/rclone.conf
to the rclone.conf
file in the same directory as docker-compose.yml
.
Another way is to see the rclone documentation for the remote you want to setup. They have examples for most of the remotes.
Examples of remotes:
- Webdav remote