File Storage

Configuring File Storage

Your R2R deployment can be configured to utilize the Postgres large object module or S3 to store the raw files that have been sent to the server.

While Postgres large objects provide a convenient single-system approach, S3-compatible storage offers several advantages for production deployments including better scalability, cost efficiency, backup simplicity, and reduced database load.

For smaller deployments or development environments, Postgres storage is perfectly adequate. Consider choosing S3 if your file storage needs grow or when deploying to production environments with higher availability requirements.

File Storage Configuration

To customize the file storage settings, you can modify the file section in your TOML configuration file. Learn more about working with R2R config files.

Postgres Large Objects

When using Postgres as your file storage provider, R2R leverages Postgres’ large object module to efficiently store binary data. This approach keeps your files and metadata in a single database, simplifying your infrastructure. To use Postgres for file storage, simply set the provider to “postgres” in your configuration file as shown in the example above. No additional parameters are required, as R2R will use your existing Postgres connection.

S3

R2R’s S3 integration is designed to work with any S3 compatible storage API.

MinIO

MinIO offers high-performance, S3 compatible object storage that is software-defined and 100% open source under GNU AGPL v3.

The R2R Docker Compose file includes a MinIO profile, which will pull the official MinIO image. The MinIO container exposes a web console, availible at http://localhost:9001. The default username and password for the console are both minioadmin, and configurable in the /docker/env/minio.env file.

MinIO console with files.
MinIO console

Supabase

At the time which this documentation was written, there were known bugs with Supabase S3 storage, which resulted in errors for the following file types; this issue seems related to bugs reported in the Supabase Github repository.

Note that the following file types may not work with Supabase S3 storage: HEIC, JPEG, MSG, PPT, TIFF, P7S, PNG, JPG, JSON, XLS, DOC