Infrastructure

Magento Static Content Deployment Problems

Static deployment turns themes into served assets, and it is where deploys break the storefront. Here are the common problems and how to prevent them.

Jason Schuman · March 21, 2026

Static content deployment is where deploys go wrong

Static content deployment is the step that turns a store's themes and modules into the CSS, JavaScript, and images the storefront serves. When it goes wrong, the symptoms are immediate and visual: unstyled pages, stale assets, and broken layouts.

These problems are common precisely because the step is easy to get wrong or skip. A deploy that reported success can still leave the storefront serving old or missing assets.

This article covers how static content deployment works, the problems that recur, and how to prevent them so deploys stop breaking the storefront's appearance.

How static content deployment works

In production mode, the storefront serves static assets from pub/static, generated ahead of time rather than built on demand. The command bin/magento setup:static-content:deploy produces those files per theme and locale.

Each deployment gets a version, stored in deployed_version.txt, which drives the version string appended to asset URLs. That string is how browsers know to fetch fresh files instead of using cached ones.

The whole mechanism exists to keep the storefront fast, serving pre-built assets. It only works when the assets are actually built and the version string actually changes.

The stale-asset problem

The most common problem is stale assets after a deploy. New code ships, but the storefront serves the old CSS and JavaScript, so the changes do not appear or the layout breaks.

Stale assets after a deploy usually mean static content was not regenerated, or the version string did not change. Browsers keep serving the cached old files because nothing told them the assets were new.

The fix is ensuring static content is deployed as part of every release and the version bumps. When both happen, browsers pull fresh assets; when either is skipped, the storefront shows old ones.

Missing assets and 404s

Another failure is assets that are missing entirely, producing unstyled pages and 404s on asset URLs. This happens when the deployment did not build the theme or locale the storefront is requesting.

A store with multiple themes and locales has to deploy all of them, and missing one leaves that theme's pages without their styling. The storefront requests files that were never generated.

Confirming that every active theme and locale is included in the deployment prevents this. The deployment has to cover everything the storefront will actually request.

Permission problems on pub/static

Static content deployment writes to pub/static, and permission problems there cause failures. If the deploying user or the web server cannot write or read the directory correctly, deployment errors or the assets cannot be served.

This ties static content to the two-user ownership model. Files owned by the wrong user, or a directory the web server cannot read, break asset serving even when the deployment itself ran.

Confirming ownership and permissions on pub/static is part of a reliable deploy. It is a frequent cause of a deployment that appears to run but leaves assets unserved.

The developer-mode trap

A store accidentally left in developer mode does not use pre-deployed static content the same way. It generates and symlinks assets on demand, which masks static deployment problems in one environment and exposes them in another.

This is why a store can look fine in a developer-mode staging environment and break when the same code reaches production mode. The two modes handle static content differently.

Confirming the deploy mode with bin/magento deploy:mode:show is part of diagnosing static problems. Production mode is where static content deployment must be correct, because there is no on-demand fallback.

Preventing the problems

Prevention is a matter of a consistent deploy process. Static content deployment, with a version bump and cache handling, has to be a fixed step in every release, not something done sometimes.

Automating it removes the human error. When the deploy pipeline always runs the static deployment, in production mode, covering every theme and locale, the stale-and-missing-asset problems stop happening.

Verifying it afterward closes the loop. Checking that assets are current, and that the version string changed, confirms the deployment did what it was supposed to.

Verifying assets after deploy

The last step is confirming the deployment actually worked, which is quick and often skipped. Loading a key page and checking that its assets are current, with the new version string, confirms the storefront is serving fresh files.

Checking the browser network view shows whether assets are loading correctly or returning 404s, and whether the version string changed. This catches a failed or partial deployment immediately, rather than letting a customer find the broken styling.

This verification is the static-content half of a post-deploy health check. A deploy is not done when the commands finish; it is done when the storefront is confirmed to look right.

Boring deploys, correct assets

Static content deployment problems are among the most visible deploy failures and among the most preventable. They come from skipping the step, missing a theme, or a mode or permission problem, all of which a consistent process avoids.

Knowing that your deploys always regenerate static content correctly, in production mode, with the version bumped, keeps the storefront's appearance from breaking on release. Building that reliability into deploys is a practical part of an infrastructure review.