Magento 2 modes: default, developer and production

There are 3 Magento 2 modes of operation that your system will be running on: developer, product, and default mode. This setting is configured in your app/etc/env.php file, which is the value of the ‘MAGE_MODE’ key.

Magento Mode value in app/etc/env.php
Your current Magento 2 modes can be seen in app/etc/env.php file

Now we should know what each of the three Magento 2 modes does to your system. The developer mode, which is the mode you will be using most of the time, will display all exceptions, and undefined variables…

Running on developer mode, your system will also turn on code generation, which is needed for the system’s object system. Front-end files such as js, CSS, and template file generation will also be available.

Uncaught exceptions display in the browserIn Magento 2 developer mode, uncaught exceptions will display in the browser

Running your system on developer mode will make your developing extensions on Magento 2 easier for sure. But when the customers want to deploy Magento on their server, they will be using production mode, which will hide MOST of the errors, and turn off code generation. When you switch from production to developer mode, you have to clear generated classes and objects in var/generation to prevent errors.

The default mode is the combination of the two above, which will suppress error messages but will turn on code generation. We don’t normally use this mode.

To switch Magento 2 modes, either edit the file in app/etc/env.php or use the command:

Php bin/magento deploy:mode:set <mode>

You might want to clean the cache after that:

Php bin/magento cache:clean

So that’s all information about the three modes of Magento 2 and how to switch between these modes that you should know. Don’t hesitate to reach out if you need additional details about our Magento development services, or want us to migrate your website to the powerful Magento eCommerce platform. Even in times of struggle with configuring our modules for your store, we will be at your service. Don’t forget that here at Magenest we guarantee remarkable quality services always available at a competitive price!

Latest Insights

eCommerce Statistics 2022 and the Trends
you need to know

Don't want to miss out on our latest insights?
Subscribe to our newsletter.


Disclaimer: By clicking submit, you agree to share your information with us to receive news, announcements, and resources when they are available.