By default, this playbook configures your server to store Synapse’s content repository (media_store) files on the local filesystem. If that’s okay, you can skip this document.
As an alternative to storing media files on the local filesystem, you can store them on Amazon S3 or another S3-compatible object store.
You can do this either by sticking to Synapse’s media repository and making that use S3 (read below for this method), or by switching to an external media storage implementation like matrix-media-repo.
First, choose an Object Storage provider.
Then, create the S3 bucket.
Finally, set up S3 storage for Synapse (with Goofys, synapse-s3-storage-provider, or use s3 datastore with the matrix-media-repo).
You can create Amazon S3 or another S3-compatible object storage like Backblaze B2, Wasabi, Digital Ocean Spaces, Storj, etc.
Amazon S3 and Backblaze B2 are pay-as-you with no minimum charges for storing too little data. Note that Backblaze egress is free, but for only certain users for up to 3x the amount of data stored. Beyond that you will pay $0.01/GB of egress.
Wasabi has a minimum charge of 1TB if you’re storing less than 1TB, which becomes expensive if you need to store less data than that. Likewise, Digital Ocean Spaces has also a minimum charge of 250GB ($5/month as of 2022-10). Though Storj does not set minimum amount of data to be stored, it also charges $5 minimum monthly usage fee since July 1, 2025, if your monthly usage (storage, bandwidth, and segments) totals less than $5.
Here are some of the important aspects of choosing the right provider:
Now that you’ve chosen an Object Storage provider, you need to create a storage bucket.
How you do this varies from provider to provider, with Amazon S3 being the most complicated due to its vast number of services and complicated security policies.
Below, we provider some guides for common providers. If you don’t see yours, look at the others for inspiration or read some guides online about how to create a bucket. Feel free to contribute to this documentation with an update!
You’ll need an Amazon S3 bucket and some IAM user credentials (access key + secret key) with full write access to the bucket. Example IAM security policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1400105486000",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::your-bucket-name",
"arn:aws:s3:::your-bucket-name/*"
]
}
]
}
Note: This policy needs to be attached to an IAM user created from the Security Credentials menu. This is not a Bucket Policy.
To use Backblaze B2 you first need to sign up.
You can’t easily change which region (US, Europe) your Backblaze account stores files in, so make sure to carefully choose the region when signing up (hint: it’s a hard to see dropdown below the username/password fields in the signup form).
After logging in to Backblaze:
matrix-example-media-store)s3.us-west-002.backblazeb2.com).matrix-example-media-store)The keyID value is your Access Key and applicationKey is your Secret Key.
For configuring Goofys or s3-synapse-storage-provider you will need:
https://us-west-002)STANDARD. Backblaze B2 does not have different storage classes, so it doesn’t make sense to use any other value.For other S3-compatible providers, you most likely just need to create an S3 bucket and get some credentials (access key and secret key) for accessing the bucket in a read/write manner. You may not need to configure security policies, etc.
For details about setting up a bucket at Storj, please see the instruction here to get started.
To set up Synapse to store files in S3, follow the instructions for the method of your choice: