1 import { getOsShortcut, Kbd } from "docs-ui"
2
3 export const metadata = {
4 title: `S3 Storage`,
5 }
6
7 # {metadata.title}
8
9 In this guide, you'll learn about the managed S3 storage service that Medusa provides as part of your project environments on Cloud.
10
11 ## Managed S3 Storage Service on Cloud
12
13 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.
14
15 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.
16
17 ![Diagram showcasing S3 isolation between environments](https://res.cloudinary.com/dza7lstvk/image/upload/v1750230909/Cloud/s3-cloud_smrtfc.jpg)
18
19 ---
20
21 ## Configured S3 File Module Provider on Cloud
22
23 Medusa automatically configures your Medusa application hosted on Cloud to use the [S3 File Module Provider](!resources!/infrastructure-modules/file/s3).
24
25 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.
26
27 <Note>
28
29 If you're using a Medusa version before v2.7.0, contact support for assistance in configuring the S3 File Module Provider.
30
31 </Note>
32
33 ### Access S3 Configurations on Cloud
34
35 Since Cloud is a managed service, you can't directly access your S3 bucket.
36
37 You can, however, access the S3 bucket details of your environment. This is useful when setting remote patterns in your storefront to allow loading assets from the S3 bucket.
38
39 To access the S3 bucket details of an environment:
40
41 <Note title="Tip">
42
43 You can also navigate to a project's S3 details from the [command palette](../command-palette/page.mdx). Press <Kbd>{getOsShortcut()}</Kbd> + <Kbd>K</Kbd>, select **Storage**, then choose a project.
44
45 </Note>
46
47 1. From the [organization's dashboard](../organizations/page.mdx), click on the environment's project.
48 2. In the project's dashboard, click on the name of the environment. For example, "Production".
49 3. Click **Object** in the sidebar.
50 4. In the **Object storage** section, you can find your full S3 file URL and your S3 endpoint.
51
52 From the S3 file URL, you can extract the bucket name and region. For example, if your S3 file URL is `https://s3.eu-central-1.amazonaws.com/medusajs.cloud-data-prod-euc1-123`:
53
54 - The bucket name is `medusajs.cloud-data-prod-euc1-123`.
55 - The region is `eu-central-1`.
56
57 ### Override S3 Configurations on Cloud
58
59 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.
60
61 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.
62
63 <Note title="Tip">
64
65 To set the connection options of your external S3 instance, refer to the [Environments](../environments/environment-variables/page.mdx#add-environment-variables-on-cloud) 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.
66
67 </Note>
68
69 ---
70
71 ## Upload Files to S3 on Cloud
72
73 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.
74
75 You can also upload files using Medusa's [Upload Files API route](!api!/admin/uploads/upload-files), or in a [custom API route that handles file upload](!docs!/learn/fundamentals/api-routes/parse-body#configure-file-uploads).
76
77 ---
78
79 ## S3 Bucket Privacy on Cloud
80
81 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.