Stratus Magento 2 Guides - Deploying static files
For performance, Magento 2 generates static files from your theme and other site components. This feature is well documented in the [Magento 2 dev docs][1], but there are some tricks to deploying and generating these files on a Webscale server.
Before deploying static files, remove any files — except the .htaccess file — in pub/static.
The following should also be removed, especially when doing a production deployment.
- All folders under
pub/static var/cachevar/composer_homevar/generationvar/page_cachevar/view_preprocessedvar/di(if present)
Then the static files can be deployed using the following command (run from the bin directory in the Magento install).
php bin/magento setup:static-content:deploy
Have questions not answered here?
Contact Support
to get more help.
Last modified on June 3, 2026