Magento 2 set Deploy mode

Today we discuss about Magento 2 set deploy mode. There are three deploy mode available in magento 2 Default . Developer and Production mode. These three mode have different kind of behavior. So let talk about deploy mode in details. You can set deploy mode with following command.

Set deploy mode

php bin/magento deploy:mode:set

Show deploy mode

php bin/magento deploy:mode:show

Default Mode:

This is by default when new magento 2 installed. Following behavior default mode have.

  • errors logged in var/report, not displayed
  • static created dynamically – copied! changes not visible. cached

Developer Mode:

Developer mode is min speed. You can set developer mode with following command.

php bin/magento deploy:mode:set developer
  • exceptions displayed, not logged
  • exception thrown if bad event subscriber.
  • var/report detailed
  • static created dynamically – symlinked???, changes visible immediately
  • error handler – throws exception instead of logging (notice etc.)

Production Mode

Production mode have max speed, no errors, no file generation. You can set production mode with following command.

php bin/magento deploy:mode:set production
  • admin can’t enable/disable cache types
  • errors logged, not displayed
  • static not created dynamically, must be deployed
  • not need for www-data to write, pub/static can be read-only

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