How Strapi uploads move into Cloudinary with the official provider
The Cloudinary integration is the official media library provider for Strapi. It stores files that editors upload in the Strapi media library in Cloudinary, and it lets the front end request transformed versions of those files, such as resized or reformatted images, from Cloudinary's delivery URLs. The provider is configured in the Strapi project, in the plugin configuration that selects the upload provider and passes Cloudinary credentials and options. Two areas need extra attention before go-live: admin panel preview security, because the admin panel must load images from Cloudinary, and existing media, because files already in the local upload folder do not move on their own.
The provider does not replace your content model. Content types, components and relations stay as they are, and each media field still points to a file record in the media library. What changes is where the binary lives and how its URL is built. That means your content modeling decisions, field names and populate queries remain valid, but any code that assumes files are served from the Strapi server, such as hard-coded /uploads paths or local file checks in build scripts, will need review. Confirm the provider version your Strapi 5 release expects in the official Cloudinary provider documentation before you pin it.
Decide early who owns the Cloudinary account, which folder structure and naming rules apply to uploads, and whether transformations are requested by URL parameters or by stored presets. Ask for the expected account and credential handling in the quote, since this affects secret storage, environment separation and who can rotate keys. Then plan the security middleware change described in the next section, and test one representative upload path, including a preview in the admin panel, in a non-production environment before you migrate any existing files.
What a Cloudinary media setup needs before configuration
Before touching the Strapi media library settings, five things need to be settled: the Strapi version and hosting, the Cloudinary account, where secrets live, the network path between the server and Cloudinary, and the provider's compatibility with your Node.js runtime. Each one changes the configuration work that follows.
Strapi version and hosting context
Confirm which Strapi major version and release line your project runs, and whether it is self-hosted or on Strapi Cloud. Strapi 5 is the current line, and the Strapi v4 line reached end of life on April 30, 2026, so a v4 project should plan its upgrade before adding a new provider. Record the exact version in your project so the provider package you install matches it.
Cloudinary provider docsConfirm compatibility with the installation docs
Do not assume the Cloudinary provider supports your Strapi version or Node.js release. Check the supported Strapi version and Node.js requirements in the provider documentation and compare them with the Strapi installation requirements, which list supported databases and only Active or Maintenance LTS Node.js versions. Pin the Node.js version in your build image and record the check in your change ticket.
Strapi installation requirementsCloudinary account and API credentials
Create or identify the Cloudinary account that will own the uploads, and decide who administers it. Generate API credentials for the Strapi server only, with the narrowest access the provider needs, and document which team owns rotation. Ask your platform team who approves new API keys and where the account's audit history is kept.
Secrets kept out of source control
Cloud credentials must not be committed to the repository, placed in a .env file tracked by Git, or baked into container images. Store them in the secrets mechanism your deployment already uses, such as a managed secret store or your orchestrator's secret objects, and reference them as environment variables at runtime. Scan the repository for accidental keys before the first deployment.
Deployment target for environment variables
Decide where the variables are set for each environment: local development, staging and production. Use separate Cloudinary credentials or folders per environment so test uploads do not mix with production media. Confirm that your CI/CD pipeline injects the variables at deploy time and that a restart picks them up, since changes to environment values usually need a process restart.
Outbound network access to Cloudinary
The Strapi server, not the browser, uploads and manages files, so its network must allow outbound HTTPS to Cloudinary's API endpoints. Check egress rules, proxies and any firewall allowlists in regulated networks, and test from the actual runtime, not your laptop. Browsers also need to load transformed images, so confirm that the delivery host is reachable from the places your editors and visitors use.
Configuring the Cloudinary provider step by step
This sequence takes a Strapi project from a default local media library to uploads that are stored in Cloudinary and served from Cloudinary URLs. Each step ends with a check you can run before moving on.
Confirm the Strapi version and project baseline
Before installing anything, confirm your Strapi project runs and that the admin panel loads with the default media library. Check the Strapi version in package.json and the Node.js version against the installation requirements, since Strapi 5 runs only on Active or Maintenance LTS Node.js versions. Make a database backup first so the configuration can be reverted cleanly. You are done when the admin panel opens, a test image uploads to the local provider, and the backup is stored outside the project folder.
Create Cloudinary credentials and a dedicated account scope
In your Cloudinary account, create or identify the cloud name, API key and API secret that the Strapi project will use, and confirm with your platform or security team who owns the account and which environment it belongs to. Prefer a separate Cloudinary environment or sub-account for development and production so that test uploads do not mix with live media. Record where the secrets will be stored, such as your secrets manager or CI variables, and do not paste them into source control. You are done when you have a named credential set per environment and an agreed owner for each.
Install the official Cloudinary provider package
A developer installs the official Cloudinary media library provider package in the Strapi project using the package manager the project already uses, then restarts the development server. Check the Strapi Cloudinary provider documentation for the package name and the compatible version for your Strapi release, because compatibility depends on the Strapi version you run. You are done when the install completes, the lock file changes are committed, and Strapi starts without module resolution errors.
Add the provider configuration with environment variables
In the project configuration for the upload plugin, typically config/plugins, set the upload provider to Cloudinary and pass the cloud name, API key and API secret read from environment variables such as CLOUDINARY_NAME, CLOUDINARY_KEY and CLOUDINARY_SECRET in your .env file or deployment environment. Do not hard-code the values. Choose the folder and upload options your content model needs, and keep them in the same configuration file so they are reviewed with code changes. You are done when Strapi restarts cleanly and the configuration file contains references to environment variables only.
Adjust the security middleware for provider previews
When an upload provider serves media from another domain, the admin panel may fail to display previews because the default content security policy blocks those images. A developer should review the middleware configuration, add the Cloudinary image host to the permitted image sources in the custom content security policy, and keep every other directive as narrow as the project requires. Ask your security team to review the change, since it widens what the admin panel can load. You are done when a restart shows previews in the admin panel without relaxing unrelated directives.
Upload a test file from the media library
In the admin panel, open the media library and upload a test image and, if your editors use them, a test video or document. Confirm the upload completes without errors and that the asset appears in the Cloudinary console under the folder you configured. Check that the upload options, such as folder placement and naming, match what you set in the configuration. You are done when the file is visible in both the Strapi media library and the Cloudinary console.
Confirm the returned URL points to Cloudinary
Attach the test asset to a content type field in a draft entry and save it, then open the entry through the REST API or the admin panel and inspect the url field of the media object. The URL should use your Cloudinary host, not the local uploads path of the Strapi server. Open the URL in a browser to confirm it resolves. You are done when the entry shows the Cloudinary provider URL and the file loads from Cloudinary.
Why admin previews fail after switching providers
When Strapi switches from the local upload provider to Cloudinary, the admin panel starts loading media from a new host. Editors see broken thumbnails and blank previews in the Media Library even though the files uploaded correctly. The usual cause is Strapi's security middleware, which applies a content security policy by default. That policy controls which hosts the browser may load images, media and scripts from, and a Cloudinary domain is not on the default list. The browser blocks the request, and the failure appears only as a console message, so the problem can look like a provider fault when it is a policy fault.
The fix belongs in the middleware configuration, not in the provider settings. Strapi's middlewares docs describe how the strapi::security middleware accepts custom directives in config/middlewares.js (or .ts). The team needs to add the Cloudinary image and media hosts to the relevant directives, such as img-src and media-src, and keep the list as narrow as the provider documentation allows. The exact hostnames and directives depend on the Cloudinary provider docs and on your deployment, including whether the admin panel is served from a separate host. Confirm them in your own environment, then reload the admin panel with the browser developer console open and check that no content security policy violations remain.
Treat this as a change to review, not a one-line patch. Widening the policy affects every page the admin panel serves, so the change should be tested in a non-production environment that mirrors the production hostnames and reverse proxy headers. Record which directives changed and why, because a security reviewer will ask. If the team also uses a custom CDN or a separate admin hosting setup, each of those origins needs its own check. Ask Cloudinary and your Strapi version's documentation to confirm the current host names before you copy any values into the configuration.
How an upload, transform and admin preview travel through the stack
The path starts when an editor uploads a file in the Strapi admin panel. Strapi hands the file to the Cloudinary provider, which stores the asset and returns a delivery URL that Strapi saves with the entry. When the admin panel or the public front end displays an image, the request goes to Cloudinary, and the security middleware in Strapi decides whether the admin panel is allowed to load media from that external host. Check that the content security policy names the Cloudinary host before you test previews.
Upload, storage, delivery and admin preview paths for Strapi with Cloudinary.
Which Strapi media fields map to Cloudinary assets
This table pairs each Strapi media attribute with the Cloudinary value it corresponds to, and notes whether Strapi keeps the value in its database after upload. Read it before migration to decide which values you can trust from Strapi and which you must re-check against Cloudinary once assets have moved.
| Strapi attribute | Cloudinary value | Kept in Strapi database after upload | Re-check after migration |
|---|---|---|---|
| File name | Public ID (includes folder path and base name) | Yes, as the original name | Confirm the public ID matches the name editors see in the library |
| MIME type | Resource type and format | Yes | Confirm images, video and raw files land under the expected resource type |
| Size in bytes | Bytes | Yes | Compare totals per folder after transfer |
| Dimensions (width, height) | Width and height | Yes, for images | Check that transformed URLs still use the correct source dimensions |
| Alternate text | No direct equivalent in the upload response | Yes, stored on the file entry | Confirm alt text still renders on the front end after the URL change |
| Folder or path | Asset folder and public ID prefix | Partly, depending on provider settings | Verify folder placement matches your editorial structure |
| Stored URL | Secure URL (delivery URL) | Yes, the URL saved on the entry | Update saved URLs and confirm the admin panel can load previews under your security middleware settings |
Securing credentials, previews and asset access
Cloudinary integrations touch three trust boundaries: the server that holds API secrets, the admin panel that renders media previews, and the people and roles that can add or remove assets. The cards below cover each boundary and the decisions to settle with your security team before go-live.
Keep API secrets out of the admin build
The Cloudinary provider needs an API key and API secret for uploads and deletions. These values belong in environment variables or a secret store that the Strapi server reads at runtime, never in admin panel customizations or front-end bundles. Check that no file under the admin source or the built admin assets references the secret, and that rotation can happen without a code change. Confirm with your team who can read the secret store and how access to it is logged.
Cloudinary provider docsLimit the CSP to named Cloudinary hosts
When a third-party upload provider is used, Strapi's security middleware generally needs a custom content security policy so the admin panel can display provider media. Add only the specific Cloudinary hosts your account uses to the image and media directives, rather than broad wildcards that would allow any subdomain to load content into the admin. Review the policy after every change to the provider settings, and ask the security team to sign off on the exact host list.
Middlewares configurationReview who can upload and delete
Upload and delete rights in the Media Library reach the Cloudinary account, so a deleted asset may disappear from every page that references it. Map which Strapi roles can upload, replace and delete media, and restrict deletion to a small group of editors or administrators. Ask whether deletions in Strapi also remove the file in Cloudinary, and whether that behavior matches your retention rules for published content.
Decide between public and signed assets
Assets delivered from Cloudinary can be public, where anyone with the URL can fetch them, or signed, where delivery requires a signature generated with your credentials. Public delivery is simpler and works well for marketing images, while signed delivery suits documents, unreleased material or personal data. Confirm which content types fall into each group, and test that signed URLs still render in the admin preview and on the live front end.
Check upload permissions in Strapi roles
Strapi roles control who can reach the upload endpoints and the Media Library, separately from the content types that reference the files. Review the public and authenticated role settings for upload actions, since an open upload permission lets anonymous callers push files into your Cloudinary account. Test each role with a real request after changes, and keep a record of the permission matrix that the reviewers can check.
Moving existing media into Cloudinary without broken references
The first decision is how the existing files reach Cloudinary. Re-uploading through the provider means the Strapi media library's Cloudinary provider receives each file again, so Strapi writes new file records and the provider assigns the new URLs. Scripting the transfer from the current storage location is the other route: a script reads each file from the old bucket or disk, uploads it to Cloudinary with a chosen public ID, and then updates the stored URL fields in the database so that existing entries point at the new location. The scripted route suits large libraries and gives you a repeatable run you can rehearse, but it touches database rows directly, so you need a tested rollback. Whichever route you choose, keep the old storage location live and readable until you have verified every reference. Do not delete source files at cutover. Confirm with your team which Strapi files table fields hold URLs and formats in your version before writing any update logic.
Start with an inventory. List every file record in the Strapi media library, the entries and components that reference each file, and any hard-coded URLs in front-end code, emails or external documents that point at the old location. Decide whether to preserve file names or public IDs. Keeping a predictable public ID, derived from the original file name and folder, makes it easier to find assets later and to rerun a failed batch without creating duplicates, while a generated ID avoids collisions but needs a mapping table. Record the mapping from old path to new public ID in a file you keep with the migration evidence.
Before you switch the front end or the database URLs, compare counts and sample renders. Counts should match between the old storage listing, the inventory and Cloudinary, with any gaps explained (for example, failed uploads or deleted files). Then render a sample across image types, sizes, PDFs and video, including files used in previews and in the admin panel. Check that the admin panel displays the Cloudinary media, which depends on the content security policy changes described in the previous section. Ask your DeployOpen or internal reviewer to sign off on the sample list, and only remove the old location after a defined period of stable production traffic with no broken asset requests in your logs.
Common Cloudinary media failures and their fixes
This table pairs each common failure in a Strapi and Cloudinary setup with its likely cause and the check or fix to apply first. Read it when uploads, previews or existing media break, and work down the list in order, since a missing credential or blocked policy can produce symptoms that look like several different problems.
| Failure | Likely cause | Check or fix |
|---|---|---|
| Admin panel images blocked | Strapi security middleware content security policy does not allow the Cloudinary image host | Add the Cloudinary domain to the img-src directive in the custom content security policy under the middlewares configuration, then restart and reload the admin panel |
| Uploads succeed but previews are broken | The admin panel cannot load the delivered Cloudinary URL, usually because of the policy above or a wrong delivery URL | Open the failing image URL directly in a browser, compare it with the URL stored on the entry, and check the browser console for policy violations |
| Mixed content warnings from http URLs | Stored or generated links use http while the admin panel or site is served over https | Confirm the Cloudinary provider returns https URLs and that any stored legacy URLs were not saved with the http scheme |
| Missing credentials in production | Cloudinary cloud name, API key or API secret set in local files but not in the production environment | Verify the environment variables are injected into the running Strapi process, not only the build, and test an upload in the production environment after deploy |
| Existing entries point at old storage | Entries keep URLs from the previous upload provider or local uploads folder after migration | Run a check that lists media URLs still pointing at the old host, then re-upload or rewrite those URLs and confirm the old files remain available until the check is clean |
| Transformations return errors | The requested format or transformation is not supported for that asset type, or the URL parameters are malformed | Test the transformation on one asset in the Cloudinary console, confirm the file type supports it, and adjust the format or parameter before changing the application code |
Questions teams ask before connecting Strapi to Cloudinary
How much does it cost to connect Strapi to Cloudinary?
The cost has three parts: the Cloudinary plan, the engineering work to configure and test the provider, and any migration of existing media. Cloudinary sets its own plan prices and usage allowances, so confirm the current figures on Cloudinary's pricing page or with its sales team before budgeting. The engineering part is one-time, while storage, transformations and bandwidth on Cloudinary recur monthly or annually depending on your plan. DeployOpen quotes follow a written scope, and the main drivers are the number of content types that hold media, the volume of files to move, and how many image variants your front end needs. Ask any provider for a quote that separates one-time work from recurring platform fees.
How long does a Cloudinary integration take to deliver?
Duration depends on scope, not on a fixed template. A basic provider configuration on a small Strapi project moves quickly, while a project with many content types, custom upload flows, several environments and a large media backlog takes longer. Migration volume is usually the biggest variable, because file count, file size and the need to keep existing URLs working all affect the schedule. Ask for a timeline tied to specific milestones: configuration in development, security middleware changes, a staging migration run, and production cutover with a rollback plan.
Can our internal team set up the Cloudinary provider alone?
Often yes for a straightforward setup. The official Cloudinary provider is documented by Strapi, and a team with Node.js and Strapi experience can add the provider configuration with credentials stored as environment variables. Teams usually need outside help when they must change the content security policy for previews, move existing media without breaking published URLs, or prove the setup to a security or compliance reviewer. Decide early which parts your engineers will own and which parts need a second pair of eyes.
What do we need to provide before the work starts?
Expect to provide a Cloudinary account with an agreed plan, API credentials for a non-personal service account, access to the Strapi codebase and its staging and production environments, and a list of content types that store media. You also need a copy of the production database and media storage for migration testing, a named owner for editorial sign-off, and the front-end domains that will request images. Agree on who holds the Cloudinary account and how credentials rotate before anything is configured.
Does Strapi's security middleware need changes for Cloudinary previews?
Usually yes. When a third-party upload provider is used, Strapi's security middleware generally needs a custom content security policy so the admin panel can display media served from the provider's domain. Without it, previews in the Media Library may be blocked by the browser. Change only the directives that the provider requires, scope them to the admin panel, and test in each environment. Keep the policy as narrow as possible, and document why each added source is present for your security review. The middleware configuration is set in the Strapi project, and the exact directives depend on your Strapi version and the provider's delivery URLs.
Can we move existing media from local storage into Cloudinary?
Yes, but existing media needs a deliberate plan. Moving files means uploading them to Cloudinary, recording their new URLs or public IDs, and updating references so published pages keep working during and after the switch. Test on a copy of production first, compare file counts and checksums, and confirm that transformations and alt text survive the move. Plan how to handle files uploaded while the migration runs, and keep the original storage available until your team has verified the result.
What must we retest after a Strapi or provider upgrade?
Retest anything that touches media after each Strapi minor release and each provider update. The checklist should include uploads from the admin panel, Media Library previews, image URLs returned by the REST and GraphQL APIs, transformations and responsive variants, deletion behavior, and the content security policy. Also verify that environment variables and credentials still load in every environment. Strapi 5 ships minor releases frequently, so schedule regular regression checks rather than testing only before a major upgrade.
How DeployOpen works on this
DeployOpen plans and builds the Strapi media setup with Cloudinary inside your own environment, starting from a written scope that names the content types, upload flows and preview paths involved. Work moves through a build, a verification pass and a handover your team can run without us.
How we scope
- We inventory existing uploads, content types and front-end consumers that read media URLs from Strapi.
- We agree in writing which Cloudinary account, folders, transformations and access settings the integration will use.
- We document the security middleware changes needed for admin previews and list them as explicit scope items.
How we build
- We configure the official Cloudinary provider in a staging Strapi project before touching production settings.
- We adjust the content security policy for the admin panel so editors can see provider-hosted media without loosening unrelated rules.
- We test a migration of existing media on a copy of the data, with checks on file counts, URLs and broken references.
How we hand over
- You receive configuration documentation covering provider settings, environment variables and middleware changes.
- We write a runbook for rerunning the media move, rolling back a change and rotating Cloudinary credentials.
- We walk your engineers through the verification checklist so they can repeat it after future Strapi upgrades.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer if you want us to keep the integration current.
- Ask us to confirm how a retainer would cover Strapi minor releases and Cloudinary account changes in your scope.

