export const metadata = {
  title: `S3 Storage`,
}

# {metadata.title}

In this guide, you'll learn about the managed S3 storage service that Medusa provides as part of your project environments on Cloud.

## Managed S3 Storage Service on Cloud

Medusa offers a managed S3 storage service for your project environments on Cloud. Each environment has its own dedicated S3 bucket that is automatically provisioned when the environment is created.

So, when you create a new project, Medusa creates a production S3 bucket for the production environment. If you create a staging environment, Medusa creates a separate S3 bucket for that environment as well.

![Diagram showcasing S3 isolation between environments](https://res.cloudinary.com/dza7lstvk/image/upload/v1750230909/Cloud/s3-cloud_smrtfc.jpg)

---

## Configured S3 File Module Provider on Cloud

Medusa automatically configures your Medusa application hosted on Cloud to use the [S3 File Module Provider](!resources!/infrastructure-modules/file/s3).

So, you don't need to configure the S3 File Module Provider or set up S3 manually. Also, if you have the S3 File Module Provider configured in `medusa-config.ts`, remove it to avoid conflicts.

<Note>

If you're using a Medusa version before v2.7.0, contact support for assistance in configuring the S3 File Module Provider.

</Note>

### Access S3 Configurations on Cloud

Since Cloud is a managed service, you can't directly access your S3 bucket or its configurations. Medusa also doesn't expose the S3 bucket connection or configuration details.

### Override S3 Configurations on Cloud

If you need to override the default S3 configurations of your Cloud project, such as changing public access to assets, you can do so by setting up and managing your own S3 bucket externally.

Then, configure the S3 File Module Provider in your `medusa-config.ts` file to connect to your external S3 instance. Refer to the [S3 File Module Provider documentation](!resources!/infrastructure-modules/file/s3) for more details on how to configure it.

<Note title="Tip">

To set the connection options of your external S3 instance, refer to the [Environments](../environments/environment-variables/page.mdx#add-environment-variables) guide to learn how to add environment variables. You can then use these variables in your `medusa-config.ts` file to connect to your S3 instance.

</Note>

---

## Upload Files to S3 on Cloud

When you upload files through your Medusa application hosted on Cloud, such as product images or other assets, the files are stored in the S3 bucket associated with that application's environment.

You can also upload files using Medusa's [Upload Files API route](!api!/admin#uploads_postuploads), or in a [custom API route that handles file upload](!docs!/learn/fundamentals/api-routes/parse-body#configure-file-uploads).

---

## S3 Bucket Privacy on Cloud

By default, the S3 bucket of your Cloud projects is private, but the files you upload to the bucket are publicly accessible. This is necessary for serving product images and other assets in your Medusa application.
