🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Regenerate CSS File in pub/static Folder in Magento 2

By Sanjay JethvaUpdated on May 22, 2025 2 min read

Made a CSS change into the files of your theme?

Not able to see those changes in the pub/static folder?

Not being rendered on the frontend of the Magento 2 store?

No worries, I got your back here.

Read the solution to regenerate CSS file in pub/static folder in Magento 2.

As a store owner, you may want to change the layout or design on the frontend from time to time to keep the content updated according to the latest trend, potential customers’ taste or as your products or services get updated. However, you may have the issue reflecting the changes on the frontend that you implemented from the admin panel.

One of the reasons may be the failure of generating CSS file in pub/static folder in Magento 2.

Hence, you will have to regenerate CSS file in pub/static folder in Magento 2 to offer the new or updated content in the storefront to the customers.

Here’s how you can do it:

The solution to regenerate CSS file in pub/static folder in Magento 2:

Run the following commands to re-generate CSS, JS files, etc.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f for Magento 2.2.x and Magento 2.3.x.If you are using Magento 2.1.x, use php bin/magento setup:static-content:deploy

If you face a permission issue, give 777 permission to pub/static generated var folders for Magento 2.2.x and Magento 2.3.x.For Magento 2.1.x, give permission 777 to var/view_preprocessed var/cache var/page_cache var/tmp var/generation pub/static

Note: You have to specify locale in php bin/magento setup:static-content:deploy.
e.g php bin/magento setup:static-content:deploy -f hi_IN for Hindi (India)

That was all.

Feel free to share the solution on social media with fellow developers

Thanks.

Also Read:

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.