Choose a Storage Type

Prev Next

Rocket.Chat supports several storage types for file uploads. Each has its strengths and limitations. This guide compares the options and gives recommendations based on scalability and production requirements. To configure the storage type in your workspace, see File Storage.

For production, use Amazon S3, Google Cloud Storage, or an S3-compatible service such as MinIO.

Cloud storage

Cloud object storage keeps files outside your Rocket.Chat server and database, so it scales with your workspace and works with multiple Rocket.Chat servers.

  • Amazon S3: Select AmazonS3 as the storage type. For the settings, see File Storage.

  • Google Cloud Storage: Select Google Cloud Storage as the storage type. For the settings, see File Storage.

  • MinIO: A self-hosted, S3-compatible option. Select AmazonS3 as the storage type and point it to your MinIO server. For instructions, see Configure MinIO Storage.

GridFS

GridFS is a MongoDB specification for storing and retrieving large files such as images, audio, and video. While it functions like a file system, GridFS stores its data within MongoDB collections. It is designed to handle files that exceed MongoDB's document size limit of 16MB.

GridFS divides a file into smaller chunks and stores each chunk of data in a separate document, each with a maximum size of 255KB. It uses two collections to store files:

  • fs.files stores the file's metadata.

  • fs.chunks stores the binary chunks.

For details, see the GridFS documentation.

By default, GridFS is used in Rocket.Chat for file storage because MongoDB offers this functionality with zero configuration. However, it is not recommended for production environments due to the high load it places on the database. GridFS can only be suitable if:

  • A retention policy is in place to manage file storage.

  • You are storing only a small number of lightweight files each week.

File System

The File System stores uploaded files directly on the local storage of the server running the Rocket.Chat instance. It is simple to configure and works well for small-scale, single-server deployments. Files are stored in a designated folder on the server's file system, and Rocket.Chat retrieves them directly as needed.

Configure File System storage

To use File System as the storage type, go to Manage → Workspace → Settings → File Upload and follow these steps:

  1. Go to General and select FileSystem as the Storage Type.

  2. Go to File System and specify a valid System Path on the server where files will be uploaded. For example, setting the path to /uploads will save files in an uploads directory at the root of your server.

  3. Click Save changes and restart the Rocket.Chat server. Uploaded files will now be saved to the specified system path.

Accessing the Rocket.Chat server to confirm the uploaded files varies based on your deployment method:

  • For Docker deployments, access the Rocket.Chat container with docker exec -it <container-name> sh.

When scaling Rocket.Chat to multiple servers, the File System becomes challenging:

  • The file storage directory must be accessible to all Rocket.Chat servers. This requires setting up shared storage solutions such as Network File System (NFS).

  • Managing shared storage introduces additional configuration and infrastructure overhead.

FileSystem is recommended only when you are running a single Rocket.Chat instance.

Next steps

If you use MinIO, see Configure MinIO Storage. Otherwise, to try features that are still in development, see Feature Preview.