1341 words
7 min read

Configure Amazon S3 for Rocket.Chat File Sharing

By Docker Captain · CNCF Ambassador · IBM Champion
Cover image for the post 'Configure Amazon S3 for Rocket.Chat File Sharing'

This article is for those looking for a detailed and clear guide on how to configure Amazon S3 for Rocket.Chat file sharing.

Rocket.Chat is an open-source fully customizable communications platform developed in JavaScript for organizations with high standards of data protection.

TIP

Architecture Context

Choose S3 for Rocket.Chat file storage when you need scalable, durable object storage with fine-grained IAM policies. MinIO provides a self-hosted S3-compatible alternative for on-premises deployments. S3 is the right choice when your infrastructure already runs on AWS. MinIO is justified when data residency requires on-premises storage or when you need to avoid cloud egress costs.

NOTE

For details on installing Rocket.Chat on Ubuntu Server, read my guide: Install Rocket.Chat on Ubuntu Server.

IMPORTANT

You must have an account with administrator rights to Amazon Web Services.

IMPORTANT

To set up file sharing, you need to have administrator rights in Rocket.Chat.

First, let’s create a bucket using Amazon S3. It will allow you to store files that Rocket.Chat users will exchange.

Go to the Amazon S3 Console, sign in with an account that has administrator rights (if necessary), and click the “Create bucket” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 1

In the “Bucket name” field, specify a unique DNS-compatible name for the bucket.

Note a few important things when creating a new bucket name:

  • The bucket name must be unique across all existing buckets in Amazon S3.
  • Once the basket is created, you cannot change its name.
  • Choose a bucket name that reflects the purpose of the items you plan to store in it. This is important because the bucket name appears in the URL that points to the items in it.
NOTE

This tutorial will use “rocketchat-heyvaldemar” as the bucket name.

In the “Region” field, indicate the desired region in which the basket will be created.

Click on the “Create” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 2

The cart has been successfully created.

Now you need to configure the access rights to the basket so that Rocket.Chat users can share files using this basket.

We select the previously created basket.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 3

Go to the “Permissions” tab, then select “CORS configuration”.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 4

Next, we insert the following configuration for the basket to work.

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>https://rocketchat.heyvaldemar.net</AllowedOrigin>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>HEAD</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
NOTE

In this guide, you will use the rocketchat.heyvaldemar.net subdomain to access Rocket.Chat from the Internet. You will need to specify your domain or subdomain by which Rocket.Chat will be accessible from the Internet.

Click on the “Save” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 5

The changes were saved successfully.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 6

Now you need to create a policy to access the previously created S3 bucket.

Click on the “Services” button and select “IAM” in the “Security, Identity & Compliance” section.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 7

Next, go to the “Policies” section and click on the “Create policy” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 8

Go to the “JSON” tab.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 9

Insert the following parameters for the policy.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets"
],
"Resource": "arn:aws:s3:::*"
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": "arn:aws:s3:::rocketchat-heyvaldemar"
},
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:DeleteObject"
],
"Resource": "arn:aws:s3:::rocketchat-heyvaldemar/*"
}
]
}

This guide uses “rocketchat-heyvaldemar” as the bucket name. You will need to provide your cart name.

Click on the “Review policy” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 10

In the “Name” field, specify the name for the new policy and click on the “Create Policy” button.

NOTE

In this tutorial, “RocketChatFileUpload” will be used as the policy name to access the previously created bucket.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 11

The policy has been successfully created.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 12

Now you need to create a new user and assign him the previously created basket access policy. This user will be required to connect Rocket.Chat to S3 bucket.

Go to the “Users” section and click on the “Add users” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 13

In the “User name” field, specify the name for the new user and click on the “Next: Permissions” button.

NOTE

In this manual, “rocketchat-upload” will be used as the username.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 14

Next, select “Attach existing policies directly”.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 15

In the search bar, specify the name of the previously created policy and in the search result, select the desired policy.

NOTE

In this tutorial, “RocketChatFileUpload” is used as the name of the policy to access the previously created bucket.

Click on the “Next: Tags” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 16

In the next step, you do not have to make any changes.

Click on the “Next: Review” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 17

Everything is ready to create a new user.

Click on the “Create user” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 18

The user has been successfully created and has the necessary permissions to access the previously created S3 bucket.

Now you need to save the received “Access key ID” and “Secret access key”. This data will be needed to connect Rocket.Chat to a previously created basket.

Click on the “Show” button to display the contents of the “Secret access key” section and save the contents of the section to a safe place.

Click on the “Close” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 19

The new user will appear in the “Users” section.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 20

Now we need to find the code for the region in which the cart was created.

Visit the AWS documentation page and locate the appropriate region code in the “Region” column next to the “Region Name.” Make sure it matches the region where the bucket was created.

NOTE

In this manual, the bucket was created in the “EU (Frankfurt)” region, so the required region code value is “eu-central-1”.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 21

Now you need to specify the parameters for connecting Rocket.Chat to the previously created basket.

Go to Rocket.Chat under an account with administrator rights, click on the icon with three dots in the upper left corner of the screen and select “Administration”.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 22

Next, we find the “File Upload” section.

File Uploads Enabled must be set to True.

Protect Uploaded Files must be set to True.

File Uploads Enabled must be set to True.

The “Enable Json Web Tokens protection to file uploads” parameter must be set to “True”.

In the “Storage Type” field, select “AmazonS3”.

File Uploads Enabled in Direct Messages must be set to True.

Click on the “Save Changes” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 23

Next, you need to specify the parameters in the “Amazon S3” subsection.

In the “Bucket name” field, specify the name of the previously created bucket.

In the “Access Key” field, specify the “Access key ID” obtained earlier after creating a user.

In the “Secret Key” field, enter the “Secret access key” obtained earlier after creating the user.

Enter the bucket region code, retrieved earlier from the AWS region list, into the “Region” field.

The “Proxy Avatars” parameter must be set to “True”.

Proxy Uploads must be True.

Click on the “Save Changes” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 24

Now let’s upload a file from a computer to a common channel called IT to check the correctness of uploading files to Rocket.Chat using the Amazon S3 service.

Open a channel in Rocket.Chat, then in the lower right corner of the screen, click on the plus icon and select “Computer”.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 25

Select the file you want to upload.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 26

The file is ready to upload.

Click on the “Send” button.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 27

The file has been uploaded successfully and is available to all members of the IT channel in Rocket.Chat.

Rocket.Chat users can now share files using the Amazon S3 service.

Configure Amazon S3 for Rocket.Chat File Sharing - Step 28


Vladimir Mikhalev

Docker CaptainCNCF AmbassadorIBM Champion

The Verdict — production-tested analysis on YouTube.

The Verdict

Inconvenient truths about shipping in the AI era

Container security, platform engineering, and the agentic shift — tested in production, argued without the hype. The verdict reaches your inbox the moment there's one worth sending.

Related Posts

Same category
  1. 1
    Completed Is Not Restored: Kyverno Fail-Open, a Velero Restore and an HTTP 200 That Meant 500
    DevOps & Cloud · Scale Kyverno to zero and its webhooks vanish. A Velero restore said Completed over an empty disk. A 200 carried a 500. Three statuses that reported success.
  2. 2
    Docker Hub Immutable Tags: The Image That Shipped Before It Was Signed
    DevOps & Cloud · Docker Hub immutable tags refused a per-commit tag after the version tags were already out. The image shipped, the run died, and nothing ever signed it.
  3. 3
    Docker Hardened Images Migration: A Healthy Database That Kept Nothing
    DevOps & Cloud · Moving a Compose stack to Docker Hardened Images changes user IDs, paths and tools. On the old mount path, PostgreSQL stayed healthy and kept nothing.
  4. 4
    EKS Validation on a Real AWS Account: Seven Failures No Mock Saw
    DevOps & Cloud · Proving an EKS platform on a real AWS account: twenty cents a run by estimate, about fifty on the bill, and seven failures no mocked test or kind saw.

Random Posts

Random
  1. 1
    Recovering a Corrupt Exchange Database with Stellar Repair — Real-World Lab Test
    SysAdmin & IT Pro · We deliberately broke an Exchange 2019 server to test Stellar Repair on a dirty-shutdown EDB file. The recovery process, lab setup, and lessons learned.
  2. 2
    Install Exchange Server 2019 on Windows Server 2019
    SysAdmin & IT Pro · Step-by-step guide to install Exchange Server 2019 on Windows Server 2019, including prerequisites, Active Directory setup, and admin tips.
  3. 3
    Install Nextcloud Using Docker Compose
    Self-Hosting · Complete guide to installing Nextcloud with Docker Compose and Traefik. Learn to deploy your own secure file sharing and collaboration cloud with HTTPS.
  4. 4
    GitLab CI/CD Beyond the Basics: Docker Jobs, Cache, include, rules
    DevOps & Cloud · A real .gitlab-ci.yml taken apart: Docker images per job, artifacts and cache, modular include files, secrets out of the repo, rules that skip the needless.
Configure Amazon S3 for Rocket.Chat File Sharing
https://heyvaldemar.com/configure-amazon-s3-for-rocket-chat-file-sharing/
Author
Vladimir Mikhalev
Published
2019-11-18
Updated
2026-09-02
License
CC BY-NC-SA 4.0