# How to use rclone

ElfHosted provides storage for users' application data; user content lives on bring-your-own storage attached via rclone-compatible cloud (*Hetzner Storage Box, Google Drive, OneDrive, Dropbox, etc.*). RealDebrid users have a dedicated mount product built in for direct integration.

Here's a video illustrating how to do rclone mounts:

## Meet the tools

### RcloneUI

[RcloneUI](</app/rcloneui/>) is the native UI provided by Rclone. It offers a beginner-friendly interface to configuring "configs" or "remotes" (*what rclone calls your remote storage volumes*).

RcloneUI's most important task for us is the UI-driven configuration of remotes.

It does also allow simple drag/drop transfer of files to/from remotes, but lacks the ability to **stop** a transfer.

### RcloneFM

[Rclone FM](<https://docs-internal.elfhosted.com/app/rclonefm/>) (*"File Manager"*) is an alternative rclone web UI. You can't use it to configure remotes (*use [RcloneUI](</app/rcloneui/>) for this*), but you can use it for simple side-by-side filemanager-type operations.

> [!WARNING]
>
> Rclone FM maintains its own queue which you can manage (*even deletes are queued*), but be aware that this queue persists only in your browser tab, and closing the tab will cause you to loose the queue. The active transfer will still complete though.

## Setup config

### Setup remote (Rclone UI)

Launch [RcloneUI](</app/rcloneui/>) from your dashboard, and login (*any user/pass will work*):

Create a new config for your provider. Name your remote (*can be anything, but make it sensible because it'll be the file path to your content*), and choose your provider type:

Enter your provider-specific details. Refer to the [rclone docs](<https://rclone.org/overview/>) for help:

RcloneUI will automatically take you to the "Explorer" window. Type the name of your new remote, and click "Open" to test that it's working correctly.

If you can see your files, it's setup! If not, go back to "Configs" and edit it until you **can** see your files.

## Magic Mounting 🪄

Primarily, users want to permanently mount their network storage using rclone. ElfHosted will automatically mount any configured "remote" (*"config"*) into `/storage/rclone/<remote name>`, visible to all your apps.

If you change the parameters of a mount (*say, you need to fix the credentials*), you may need to restart rcloneui with [ElfBot](<https://docs-internal.elfhosted.com/app/elfbot/>) for the changes to apply

### Mounting via SSH

When setting up an SSH remote, it's not possible to specify a non-default path in the remote config - rclone expects you to pass this path as part of the `rclone mount` command, which we don't do.

A workaround for this scenario is to create your SSH remote like thi, and to use `sftpalias` as the intended remote:

```
[sftpbase]
type = sftp
host = sftp.example.com
user = myuser
pass = <encrypted>

[sftpalias]
type = alias
remote = sftpbase:/desired/default/path
```
