Configure file uploads and storage on your workspace. To access these settings, go to Manage → Workspace → Settings → File Upload.
The file upload settings are available for self-managed workspaces only. Cloud-hosted workspaces have this pre-configured using the Amazon S3 storage type. For details on cloud-hosting services, see the Cloud Hosting Service Level Agreement (SLA).
General file upload settings
These settings control file uploads across your workspace, including size limits, accepted file types, access restrictions, JWT protection, and the storage backend.
Field | Description |
|---|---|
File Uploads Enabled | Turns file uploads on or off across the workspace. |
Maximum File Upload Size (in bytes) | Maximum allowed file size for uploads. Use |
Accepted Media Types | A comma-separated list of media types users are allowed to upload. Leave blank to accept all media types. |
Blocked Media Types | A comma-separated list of MIME types to block (with or without spaces). Takes priority over Accepted Media Types. For example, |
Protect Uploaded Files | When enabled, only authenticated users can access uploaded files. When disabled, anyone with the file URL can download it. |
Restrict files to rooms' members | Limits access to files in a room to that room's members. |
Restrict files to users who can access the room | Lets anyone with access to a room download its files, including users outside the member list, such as Livechat managers, monitors, or agents with permission to view closed rooms. Mutually exclusive with Restrict files to rooms' members, and disabled while that setting is on. |
Rotate images on upload | Automatically rotates images on upload. May reduce image quality. |
Enable JSON Web Tokens protection to file uploads | Appends a JWT to uploaded file URLs.
|
File Upload Json Web Token Secret | The JWT secret used to grant access to uploaded files without authentication. |
Storage Type | The storage backend for file uploads. Options:
We recommend Amazon S3, MinIO, or Google Cloud Storage. |
File Uploads Enabled in Direct Messages | Allows file uploads in direct messages. |
If you change the storage type, previously uploaded files won't be available unless you revert the change.
Unknown file extensions default to
application/octet-stream. To accept only known file extensions, addapplication/octet-streamto Blocked Media Types.
A Restore defaults button at the bottom of this section reverts these settings to their original values.
For more details, or if you are facing issues with file uploads, see the FAQs.
Configure file system storage
Use these settings if you selected FileSystem as your storage type. Go to Manage → Workspace → Settings → File Upload → File System and configure the following:
Field | Description |
|---|---|
System Path | The local path on the server where uploaded files are stored. |
For details on how File System storage works, see Choose a Storage Type.
Configure Google Cloud Storage
Use these settings if you selected Google Cloud Storage as your storage type. For setup details, see the Google Cloud Storage documentation.
Go to Manage → Workspace → Settings → File Upload → Google Cloud Storage and configure the following:
Field | Description |
|---|---|
Google Storage Bucket Name | The name of the bucket where files are uploaded. |
Google Storage Access ID | The access ID, or username, of the service account with access to your Cloud Storage bucket. Usually in email format, for example, |
Google Storage Secret | A |
Project ID | The project ID from the Google Cloud console. |
Proxy Avatars | Routes avatar files through your server instead of serving them directly from the asset URL. |
Proxy Uploads | Routes uploads through your server instead of serving them directly from the asset URL. |
Proxy User Data Files | Routes user data files through your server instead of serving them directly from the asset URL. Applies, for example, when exporting a room as file. |
More about Google Storage Secret
The Google Storage Secret field expects a PEM file used to connect to your Cloud Storage bucket. When you create a service account, you download a JSON file containing several variables. You need the unescaped private key and one of the certificates linked at the bottom of the JSON.
The format looks like a standard PEM file:
-----BEGIN PRIVATE KEY-----
unescaped private key goes here
-----END PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
first certificate goes here
-----END CERTIFICATE-----Paste this into Rocket.Chat to authenticate with Google and store files in the bucket.
Configure Amazon S3 file storage
Use these settings if you selected AmazonS3 as your storage type. For Amazon S3 setup, see the Amazon S3 documentation.
Go to Manage → Workspace → Settings → File Upload → Amazon S3 and configure the following:
Field | Description |
|---|---|
Bucket name | The name of your Amazon S3 bucket. |
Acl (optional) | A canned ACL configuration. See the complete list of canned ACLs. |
Access Key | Your Amazon access key ID. Leave empty if running on an EC2 instance with an attached instance profile that has the right S3 permissions on the bucket. |
Secret Key | Your Amazon secret access key. Leave empty if running on an EC2 instance with an attached instance profile that has the right S3 permissions on the bucket. If |
CDN Domain for Downloads (optional) | The CDN domain associated with your bucket, if any. |
Region (optional) | The region code of your bucket, if it isn't in the US Standard region. See the list of region codes. |
Bucket URL (optional) | Overrides the URL used for uploads. Also used for downloads unless a CDN is set. |
Force Path Style | Forces path-style URLs for the bucket. See the AWS documentation: Virtual hosting of buckets and forcePathStyle. |
URLs Expiration Timespan | How long, in seconds, Amazon S3 generated URLs remain valid. Values under 5 seconds are ignored. If files load inconsistently for users far from the server, try increasing this value. |
Proxy Avatars | Routes avatar files through your server instead of serving them directly from the asset URL. |
Proxy Uploads | Routes uploads through your server instead of serving them directly from the asset URL. |
Proxy User Data Files | Routes user data files through your server instead of serving them directly from the asset URL. Applies, for example, when exporting a room as file. |
Amazon S3 CORS configuration
Apply the following CORS configuration to your bucket:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"POST",
"GET",
"HEAD"
],
"AllowedOrigins": [
"*ROCKET_CHAT_DOMAIN*"
],
"ExposeHeaders": [],
"MaxAgeSeconds": 3000
}
]Replace
*ROCKET_CHAT_DOMAIN*with your Rocket.Chat domain, for example,https://chat.example.com. Setting CORS to*is a security risk because it allows requests from any host on the internet.
FAQs
Why am I getting a “Request Entity Too Large” error when uploading files?
This error usually means the file you’re uploading exceeds the configured upload size limit. To fix it, try the following options.
Option 1: Check your workspace upload limit
Go to Manage → Workspace → Settings → File Upload.
Increase the Maximum File Upload Size (in bytes) if needed.
Option 2: Check your reverse proxy limits
If you’re using a reverse proxy, it may enforce its own file size limits.
NGINX: Update the
client_max_body_sizesetting. For details, see this NGINX troubleshooting guide.Apache: Apache’s default settings may restrict the file upload size. To support files ≥1GB, add the
LimitRequestBody 2147483647directive to the relevant<Directory>or<VirtualHost>block in your configuration file. This increases the limit to ~2GB. Then restart Apache to apply the change.
Option 3: Check your container storage
When using any type of containerized storage, consider increasing memory allocation (for example, 6–8GB) during testing to see if this helps stabilize large uploads.
Option 4: Web browser upload limitations
If you are using a web browser to upload the files, browsers can be less reliable when uploading very large files due to network timeouts and memory constraints. If possible, try uploading the same file using the Rocket.Chat desktop app to see if it behaves differently.
Option 5: File storage type
For reliability, use Amazon S3, MinIO, or Google Cloud Storage. For a comparison, see Choose a Storage Type.
Uploading very large files can also trigger issues with MongoDB’s sort operations. If that happens, follow this guide to troubleshoot.
I don’t want to store the files on the Rocket.Chat server. What should I do?
By default, Rocket.Chat stores uploaded files on the server so they can be accessed and downloaded by other users.
Currently, there is no setting to send files without storing them.
If you want to avoid long-term file storage on your server, you can:
Use external file-sharing services: Share links from services like Google Drive or Dropbox instead of uploading files directly.
Configure file retention rules: Automatically delete uploaded files after a set period (for example, 7 or 30 days) so they are not stored permanently.
What are the files in /tmp/ufs on my server?
/tmp/ufs is a temporary staging directory inside the Rocket.Chat container used for processing in-flight files. Rocket.Chat stores data here temporarily while receiving or generating it, then deletes the files once the process finishes.
Files in this directory fall into two categories:
In-progress room uploads: Files actively being uploaded by users. Once the upload succeeds, Rocket.Chat transfers the file to your permanent storage backend and posts the message to the room. If the upload fails, the file is discarded and no message appears.
User data exports: ZIP archives generated when users request their account data. These archives contain an internal
user.jsonfile identifying the account.
Temporary files are assigned randomized strings. For room uploads, this string does not correspond to the permanent file ID in the database, so you cannot query the database directly using this filename.
Next steps
To compare the storage types and pick the right one for your deployment, see Choose a Storage Type.