> ## Documentation Index
> Fetch the complete documentation index at: https://docs.torrin.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Bring Your Own Storage

> Pipe content to your own cloud provider via rclone.

BYOS lets a user send their content to **their own cloud storage** instead of
(or alongside) the shared cache. It's built on [rclone](https://rclone.org), and
everything is **encrypted** before it leaves the server (rclone `crypt`), so the
provider only ever sees scrambled files.

## Supported providers

Google Drive, Dropbox, OneDrive, and pCloud via OAuth; Mega, PikPak, and Gofile
via account login; any S3-compatible bucket (S3, Backblaze B2, Wasabi, R2) via
keys; and anything else rclone supports by pasting an rclone remote config.

## Enabling OAuth providers

For the OAuth cloud providers, register an app with each provider and set its
client ID/secret, plus the api's public base so the OAuth redirect works:

| Variable | Description |
| - | - |
| `API_PUBLIC_URL` | The api's externally-reachable base — the OAuth redirect target. Must be reachable by the provider. |
| `GDRIVE_CLIENT_ID` / `GDRIVE_CLIENT_SECRET` | Google Drive app. |
| `DROPBOX_CLIENT_ID` / `DROPBOX_CLIENT_SECRET` | Dropbox app. |
| `ONEDRIVE_CLIENT_ID` / `ONEDRIVE_CLIENT_SECRET` | OneDrive app. |
| `PCLOUD_CLIENT_ID` / `PCLOUD_CLIENT_SECRET` | pCloud app. |

An S3-compatible bucket needs no app registration — the user just enters the
endpoint, bucket, and keys in settings.

## Using it

Once a provider is configured, a user connects their storage in the app's
settings. New downloads are encrypted and written to their provider, and
playback streams back from it, geo-routed and decrypted on the fly.

## Pooling multiple providers

Several providers can act as one encrypted pool. Add extra providers in
settings, then choose how files are placed:

* **Pool** (default): each file goes to whichever provider has the most free space, so usable space is the sum of all providers.
* **Mirror**: every file is written to all providers for redundancy (uses Nx the space).

## Exporting your config

Since everything is encrypted with your own key, you can download a ready-made
`rclone.conf` from settings and mount your storage yourself, independent of the
server. Keep it private: it holds your keys and encryption passphrase.

## Cleanup

Content on your storage stays until you remove it. You can remove a single
release from the app, or set optional rules to auto-clean by age (remove after N
idle days) or size (keep under N GB). The sweep runs daily; see `BYOS_EVICT_HOUR`
in [Configuration](/self-hosting/configuration).

<Note>
  Content on your own storage is **not** subject to the shared-cache eviction; it
  stays until you remove it. See [Storage](/self-hosting/storage).
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.