Magento 2 deploy static content theme

Today we talk about how to use command line interface to do Magento 2 deploy static content theme.Doing the static content deployment is quite a headache. So today i will tell how to deploy content smartly. Magento 2 give option to deploy language example en_US, deploy area example frontend or adminhtml also the deploy the theme example blank or luma. Now we separate these with frontend and backend. This tutorial include the single theme deploy in magento 2, area base deployment example frontend or adminhtml and local base content deploy. Here is shortcut of adding the language area and theme.
-l = language
-a = area
-t = theme

Frontend theme deployment

By default you can use below command to deploy the static content. This is deploy static content for add the languages.

php bin/magento  setup:static-content:deploy

Now we add language filter so it deploy only my specific language example en_Us

php bin/magento  setup:static-content:deploy  en_US

After adding language filter we add the area specific filter so it deploy only my area language example frontend.

php bin/magento  setup:static-content:deploy  en_US -a frontend

After adding area filter we add the theme filter so it deploy only my theme example luma.

php bin/magento  setup:static-content:deploy  en_US -a frontend -t Magento/luma

Bakcend theme deployment

Using php bin/magento setup:static-content:deploy en_US after adding language filter we add the area specific filter so it deploy only my area language example backend. Now it will deploy the backend content only.

php bin/magento  setup:static-content:deploy  en_US -a adminhtml

After adding area filter we add the theme filter so it deploy only my theme example backend.

php bin/magento  setup:static-content:deploy  en_US -a adminhtml-t Magento/backend

Qaisar Satti

Hi, I'm Qaisar Satti! I've been a developer for over 20 years, and now I love sharing what I've learned through tutorials and guides. Whether you're working with Magento, PrestaShop, or WooCommerce, my goal is to make your development journey a bit easier and more fun. When I'm not coding or writing, you can find me exploring new tech trends and hanging out with the amazing developer community. Thanks for stopping by, and happy coding!

Leave a Reply