Upload Provider Configuration for Strapi Cloud
Page summary:
Strapi Cloud enforces a 200 MB cap for non-image uploads and memory-based recommendations for images. External storage like S3 or Cloudinary requires plugin setup, security middleware, and Cloud variables.
Strapi Cloud comes with a local upload provider out of the box. However, it can also be configured to use a third-party upload provider, if needed.
Strapi Cloud upload size limits
Strapi Cloud applies 2 distinct limits to uploads. The first is a hard maximum file size, enforced at the infrastructure level for non-image files. The second is a memory-based recommendation for image files that depends on your CMS settings.
Maximum upload file size for non-image files
Non-image uploads are capped at 200MB on all Strapi Cloud plans (Free, Essential, Pro, and Scale). The cap is enforced at the infrastructure level and cannot be overridden via the strapi::body middleware configuration.
Recommended maximum upload size for image files
Image uploads are subject to an additional, memory-driven recommendation that is independent of the non-image cap and varies by image format.
When Responsive friendly upload and Size optimization are both enabled in the Media Library settings, the CMS resizes the source image and generates a set of thumbnails (small, medium, large) in the instance's memory before persisting them. This happens in-process, regardless of the configured upload provider.
Switching to a third-party provider (Amazon S3, Cloudinary, etc.) is not a workaround. The resize and thumbnail generation step still runs inside the Strapi Cloud instance and still requires memory proportional to the source image dimensions.
Actual memory usage depends on the image dimensions, format, and your Media Library settings. The values below are a recommendation, not a hard limit. Uploads above the recommended size are likely to cause the instance to run out of memory and restart.
The recommendation depends on whether Responsive friendly upload and Size optimization are enabled in the Media Library settings:
- Processing on: both settings enabled, with the default
small,medium, andlargesizes. Strapi generates the thumbnails in memory, so the safe upload size is lower. - Processing off: both settings disabled. The source image is stored as-is with no in-process processing, so the safe upload size is higher.
Recommended maximum image size, expressed in megapixels (MP), per format and plan:
- Processing on
- Processing off
| Format | Free & Essential | Pro & Scale |
|---|---|---|
| JPEG | 24 MP | 135 MP |
| PNG | 8 MP | 90 MP |
| WebP | 4 MP | 12 MP |
| TIFF | 16 MP | 125 MP |
| AVIF | 66 MP | 80 MP |
| Format | Free & Essential | Pro & Scale |
|---|---|---|
| JPEG | 200 MP | 265 MP |
| PNG | 20 MP | 115 MP |
| WebP | 15 MP | 40 MP |
| TIFF | 20 MP | 125 MP |
| AVIF | 74 MP | 90 MP |
The image dimensions in pixels that match a given megapixel count depend on the aspect ratio. For a square image, 1 MP is roughly 1000×1000 px, 4 MP is roughly 2000×2000 px, and 100 MP is roughly 10000×10000 px.
To upload larger images, disable Responsive friendly upload and Size optimization in the Media Library settings. The CMS then stores the source file as-is without in-process processing.
Configuring a third-party upload provider
Please be advised that Strapi is unable to provide support for third-party upload providers.
- A local Strapi project running on
v4.8.2+. - Credentials for a third-party upload provider (see Strapi Market).
Configuring a third-party upload provider for use with Strapi Cloud requires 4 steps:
- Install the provider plugin in your local Strapi project.
- Configure the provider in your local Strapi project.
- Configure the Security Middleware in your local Strapi project.
- Add environment variables to the Strapi Cloud project.
Install the Provider Plugin
Using either npm or yarn, install the provider plugin in your local Strapi project as a package dependency by following the instructions in the respective entry for that provider in the Marketplace.
Configure the Provider
To configure a 3rd-party upload provider in your Strapi project, create or edit the plugins configuration file for your production environment ./config/env/production/plugins.js|ts by adding upload configuration options as follows:
- JavaScript
- TypeScript
module.exports = ({ env }) => ({
// … some unrelated plugins configuration options
upload: {
config: {
// … provider-specific upload configuration options go here
}
// … some other unrelated plugins configuration options
}
});
export default ({ env }) => ({
// … some unrelated plugins configuration options
upload: {
config: {
// … provider-specific upload configuration options go here
}
// … some other unrelated plugins configuration options
}
});
The file structure must match the above path exactly, or the configuration will not be applied to Strapi Cloud.
Each provider will have different configuration settings available. Review the respective entry for that provider in the Marketplace.
Example:
- JavaScript
- TypeScript
- Cloudinary
- Amazon S3
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
For full S3 provider configuration details (credential formats, extended options, S3-compatible services), see the Amazon S3 provider page in the CMS documentation.
module.exports = ({ env }) => ({
// ...
upload: {
config: {
provider: 'aws-s3',
providerOptions: {
baseUrl: env('CDN_URL'),
rootPath: env('CDN_ROOT_PATH'),
s3Options: {
credentials: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
},
region: env('AWS_REGION'),
params: {
ACL: env('AWS_ACL', 'public-read'),
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60),
Bucket: env('AWS_BUCKET'),
},
},
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
- Cloudinary
- Amazon S3
export default ({ env }) => ({
// ...
upload: {
config: {
provider: 'cloudinary',
providerOptions: {
cloud_name: env('CLOUDINARY_NAME'),
api_key: env('CLOUDINARY_KEY'),
api_secret: env('CLOUDINARY_SECRET'),
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
export default ({ env }) => ({
// ...
upload: {
config: {
provider: 'aws-s3',
providerOptions: {
baseUrl: env('CDN_URL'),
rootPath: env('CDN_ROOT_PATH'),
s3Options: {
credentials: {
accessKeyId: env('AWS_ACCESS_KEY_ID'),
secretAccessKey: env('AWS_ACCESS_SECRET'),
},
region: env('AWS_REGION'),
params: {
ACL: env('AWS_ACL', 'public-read'),
signedUrlExpires: env('AWS_SIGNED_URL_EXPIRES', 15 * 60),
Bucket: env('AWS_BUCKET'),
},
},
},
actionOptions: {
upload: {},
uploadStream: {},
delete: {},
},
},
},
// ...
});
Configure the Security Middleware
Due to the default settings in the Strapi Security Middleware you will need to modify the contentSecurityPolicy settings to properly see thumbnail previews in the Media Library.
On Strapi Cloud, NODE_ENV is always set to production. Changes to the global config/middlewares.ts file are overwritten on each deploy and will not take effect. Place your Security Middleware customizations in config/env/production/middlewares.ts instead. See Middleware Configuration for Strapi Cloud for details.
To do this in your Strapi project:
- Navigate to
./config/env/production/middlewares.jsor./config/env/production/middlewares.tsin your Strapi project. - Replace the default
strapi::securitystring with the object provided by the upload provider.
Example:
- JavaScript
- TypeScript
- Cloudinary
- Amazon S3
module.exports = [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'res.cloudinary.com'
],
'media-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'res.cloudinary.com',
],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];
module.exports = [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'yourBucketName.s3.yourRegion.amazonaws.com',
],
'media-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'yourBucketName.s3.yourRegion.amazonaws.com',
],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];
- Cloudinary
- Amazon S3
export default [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'res.cloudinary.com'
],
'media-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'res.cloudinary.com',
],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];
export default [
// ...
{
name: 'strapi::security',
config: {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'connect-src': ["'self'", 'https:'],
'img-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'yourBucketName.s3.yourRegion.amazonaws.com',
],
'media-src': [
"'self'",
'data:',
'blob:',
'market-assets.strapi.io',
'yourBucketName.s3.yourRegion.amazonaws.com',
],
upgradeInsecureRequests: null,
},
},
},
},
// ...
];
Before pushing the above changes to GitHub, add environment variables to the Strapi Cloud project to prevent triggering a rebuild and new deployment of the project before the changes are complete.
Strapi Cloud Configuration
- Log into Strapi Cloud and click on the corresponding project on the Projects page.
- Click on the Settings tab and choose Variables in the left menu.
- Add the required environment variables specific to the upload provider.
- Click Save.
Example:
- Cloudinary
- Amazon S3
| Variable | Value |
|---|---|
CLOUDINARY_NAME | your_cloudinary_name |
CLOUDINARY_KEY | your_cloudinary_api_key |
CLOUDINARY_SECRET | your_cloudinary_secret |
| Variable | Value |
|---|---|
AWS_ACCESS_KEY_ID | your_aws_access_key_id |
AWS_ACCESS_SECRET | your_aws_access_secret |
AWS_REGION | your_aws_region |
AWS_BUCKET | your_aws_bucket |
CDN_URL | your_cdn_url |
CDN_ROOT_PATH | your_cdn_root_path |
Deployment
To deploy the project and use the third-party upload provider, push the changes from earlier. This will trigger a rebuild and new deployment of the Strapi Cloud project.
Once the application finishes building, the project will use the new upload provider.
If you want to create a custom upload provider, please refer to the Providers documentation in the CMS Documentation.