Christy Jacob

Storage with Amazon S3

Amazon S3 (Simple Storage Service) is an object storage service that offers industry-leading scalability, data availability, security, and performance. You can use Amazon S3 to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics.

How does the integration work?

If you are using self-hosting Appwrite, you can use the Amazon S3 integration for Appwrite Storage to store your files in an S3 bucket instead of on your local hard drive. This is beneficial if you expect large volumes of data or the need to have scalable data storage for your self-hosted Appwrite instance.

How to implement

To implement the Amazon S3 provider for Appwrite Storage, there are several steps you must complete:

Step 1: Sign up on AWS

First, you must sign up for an AWS account and create an S3 bucket. Save the Bucket name and AWS Region mentioned here for later use.

Create S3 bucket

To access this bucket from Appwrite Storage, we also need to generate an access key within our AWS account. To do so, click on your username in the top-right corner, click on Security credentials, and scroll below to create an access key. Save your Access key ID and Secret access key for later usage.

Create AWS access key

Step 2: Add S3 provider to your Appwrite instance

For this step, you must self-host Appwrite if you haven’t already.

Visit the .env file created for your Appwrite instance and update the following environment variables:

Bash
_APP_STORAGE_DEVICE=s3
_APP_STORAGE_S3_BUCKET=[BUCKET_NAME]
_APP_STORAGE_S3_REGION=[AWS_REGION]
_APP_STORAGE_S3_ACCESS_KEY=[ACCESS_KEY_ID]
_APP_STORAGE_S3_SECRET=[SECRET_ACCESS_KEY]

After that, run the following Docker Compose commands in your terminal to restart your Appwrite containers and verify if the changes have been successfully applied:

Bash
docker compose up -d --force-recreate
docker compose exec appwrite vars

Step 3: Test the provider

To test your S3, open your Appwrite project, go to the Storage page, create a new bucket, and upload a file.

File on Appwrite Storage

When you visit your S3 bucket via the AWS Management Console, you should see the same file uploaded there.

File on Amazon S3

Read more about S3 and Appwrite Storage

If you would like to learn more about Amazon S3 and Appwrite Auth, we have some resources that you should visit:

Become a Technology Partner

Join our Technology Partners program to integrate your solutions with Appwrite’s API, enhancing functionality and expanding your reach.

Get Started