Media Library
Page summary:Media Library centralizes all uploaded assets with search, filters, and folder organization. This documentation includes provider options, upload workflows, and explanations on inserting media into content.
The Media Library is the Strapi feature that displays all assets uploaded in the Strapi application and allows users to manage them.
Configuration
Some configuration options for the Media Library are available in the admin panel, and some are handled via your Strapi project's code.
Admin panel configuration
In the admin panel, some Media Library settings are available via the Global Settings to manage the format, file size, and orientation of uploaded assets.
Configuring settings
Path to configure the feature: Settings > Global Settings > Media Library.
-
Define your chosen new Media Library settings:
Setting name Instructions Default value Generate AI captions and alt texts automatically on upload! Enabling this option will turn on AI‑powered metadata generation GrowthThis feature is available with a Growth plan. Enabled Responsive friendly upload Enabling this option will generate multiple formats (small, medium and large) of the uploaded asset.
Default sizes for each format can be configured through the code.True Size optimization Enabling this option will reduce the image size and slightly reduce its quality. True Auto orientation Enabling this option will automatically rotate the image according to EXIF orientation tag. False -
Click on the Save button.
When images in your library lack a caption or an alternative text, the AI metadata setting reports how many, and offers a Generate metadata button to generate the missing metadata in the background. Please review the results, AI can make mistakes.

Code-based configuration
The Media Library is powered in the backend server by the Upload package, which can be configured and extended through providers.
Restoring the previous Media Library
5.54.0+The Media Library described on this page is the default UI since Strapi v5.54.0. To restore the previous interface, set the useLegacyMediaLibrary property to true in the config/features file:
- JavaScript
- TypeScript
module.exports = ({ env }) => ({
useLegacyMediaLibrary: env.bool('USE_LEGACY_MEDIA_LIBRARY', false),
});
export default ({ env }) => ({
useLegacyMediaLibrary: env.bool('USE_LEGACY_MEDIA_LIBRARY', false),
});
From server code, read this configuration setting with strapi.features.isEnabled('useLegacyMediaLibrary').
Providers
The Media Library supports providers to add upload support from various third parties.
The providers maintained by Strapi are the following. Clicking on a card will redirect you to a docs page with a configuration example:
Amazon S3
Official provider for file uploads to Amazon S3.
Cloudinary
Official provider for media management with Cloudinary.
Local
Default provider for storing files locally on the server.
If you need to install other providers or create your own, please refer to the following guide:
Code-based configuration instructions on the present page detail options for the default upload provider. If using another provider, please refer to the available configuration parameters in that provider's documentation.
Private storage providers
When the configured provider is private (for example, an S3 bucket with ACL: 'private'), every file URL Strapi returns is a signed URL that expires after signedUrlExpires. Media fields are re-signed on every read, but richtext and blocks fields embed the URL directly in their value.
Strapi stores the unsigned URL for richtext and blocks fields in the database, and signs it again each time the entry is read, in the admin panel and through the REST and Document Service APIs. This also applies to richtext and blocks attributes nested in components and dynamic zones. Rows written before this behavior was introduced, which still hold a signed URL, are rewritten automatically the next time the application starts.
A file uploaded with a per-file path provider option cannot be re-signed from a richtext or blocks field: the URL is recognized as belonging to the provider, but its storage key cannot be rebuilt from the URL alone, and the signed link returns a 403 error. Media fields have the same limitation.
Available options
When using the default upload provider, the following specific configuration options can be declared in an upload.config object within the config/plugins file. All parameters are optional:
| Parameter | Description | Type | Default |
|---|---|---|---|
providerOptions.localServer | Options that will be passed to koa-static upon which the Upload server is build (see local server configuration) | Object | - |
sizeLimit | Maximum file size in bytes (see max file size) | Integer | 1000000000(1 GB in bytes) |
breakpoints | Allows you to override the breakpoints sizes at which responsive images are generated when the "Responsive friendly upload" option is set to true (see responsive images) | Object | { large: 1000, medium: 750, small: 500 } |
sharp | Configures sharp image processing options (see sharp configuration) | Object | { cache: false, concurrency: 1 } |
security | Configures validation rules for uploaded files to enhance media security (see security) | Object | - |
concurrentUploadRequests | Number of files the admin panel uploads to the server in parallel (see concurrent file uploads). Must be an integer >= 1. | Integer | 1 |
concurrentUploadSize | Number of files the server processes in parallel within a single upload request (see concurrent file uploads). Must be an integer >= 1. | Integer | 1 |
- The Upload request timeout is defined in the server options, not in the Upload plugin options, as it's not specific to the Upload plugin, but is applied to the whole Strapi server instance (see upload request timeout).
- If you wish to override the image function to generate custom file names, please refer to the Plugins extension documentation.
Example custom configuration
The following is an example of a custom configuration for the Upload plugin when using the default upload provider:
- JavaScript
- TypeScript
module.exports = ({ env })=>({
upload: {
config: {
providerOptions: {
localServer: {
maxage: 300000
},
},
sizeLimit: 250 * 1024 * 1024, // 256mb in bytes
breakpoints: {
xlarge: 1920,
large: 1000,
medium: 750,
small: 500,
xsmall: 64
},
sharp: {
cache: true,
concurrency: 4,
},
security: {
allowedTypes: ['image/*', 'application/*'],
deniedTypes: ['application/x-sh', 'application/x-dosexec']
},
concurrentUploadSize: 5,
},
},
});
export default () => ({
upload: {
config: {
providerOptions: {
localServer: {
maxage: 300000
},
},
sizeLimit: 250 * 1024 * 1024, // 256mb in bytes
breakpoints: {
xlarge: 1920,
large: 1000,
medium: 750,
small: 500,
xsmall: 64
},
sharp: {
cache: true,
concurrency: 4,
},
security: {
allowedTypes: ['image/*', 'application/*'],
deniedTypes: ['application/x-sh', 'application/x-dosexec']
},
concurrentUploadSize: 5,
},
},
})
Local server
By default Strapi accepts localServer configurations for locally uploaded files. These will be passed as the options for koa-static.
You can provide them by creating or editing the /config/plugins file. The following example sets the max-age header:
- JavaScript
- TypeScript
module.exports = ({ env })=>({
upload: {
config: {
providerOptions: {
localServer: {
maxage: 300000
},
},
},
},
});
export default ({ env }) => ({
upload: {
config: {
providerOptions: {
localServer: {
maxage: 300000
},
},
},
},
});
Max file size
On Strapi Cloud, upload size limits are enforced at the infrastructure level. They cannot be raised via the strapi::body middleware config. See Upload size limits for Strapi Cloud for per-plan values and the memory-based recommendation for image uploads.
The Strapi middleware in charge of parsing requests needs to be configured to support file sizes larger than the default of 1 GB. This must be done in addition to provider options passed to the Upload package for sizeLimit.
You may also need to adjust any upstream proxies, load balancers, or firewalls to allow for larger file sizes. For instance, Nginx has a configuration setting called client_max_body_size that must be adjusted, since its default is only 1mb.
The middleware used by the Upload package is the body middleware. You can pass configuration to the middleware directly by setting it in the /config/middlewares file:
- JavaScript
- TypeScript
module.exports = [
// ...
{
name: "strapi::body",
config: {
formLimit: "256mb", // modify form body
jsonLimit: "256mb", // modify JSON body
textLimit: "256mb", // modify text body
formidable: {
maxFileSize: 250 * 1024 * 1024, // multipart data, modify here limit of uploaded file size
},
},
},
// ...
];
export default [
// ...
{
name: "strapi::body",
config: {
formLimit: "256mb", // modify form body
jsonLimit: "256mb", // modify JSON body
textLimit: "256mb", // modify text body
formidable: {
maxFileSize: 250 * 1024 * 1024, // multipart data, modify here limit of uploaded file size
},
},
},
// ...
];
In addition to the middleware configuration, you can pass the sizeLimit, which is an integer in bytes, in the /config/plugins file:
- JavaScript
- TypeScript
module.exports = {
// ...
upload: {
config: {
sizeLimit: 250 * 1024 * 1024 // 256mb in bytes
}
}
};
export default {
// ...
upload: {
config: {
sizeLimit: 250 * 1024 * 1024 // 256mb in bytes
}
}
};