Change Magento 2 mode (developer vs production)

Unlike Magento 1 whose developer mode was basic and complex to configure, Magento 2 includes three easy to change operating modes; default, developer and production.

Default is the mode that is configured by a standard Magento install. It is almost the same as production, with some minor caches deactivated, and only serious errors logged to the browser.
Developer runs with minimal caching and rewriting, and displays all error logs to the browser, hence it is ideal for code editing and testing.
Production enables all caches, never displays any errors in the browser, and enforces a symlinked static/media setup.

How to check the current mode

  1. Enter your public_html directory (or wherever Magento is installed)
  2. Type (or copy/paste) bin/magento deploy:mode:show

Change to developer mode

  1. Enter your public_html directory (or wherever Magento is installed)
  2. Type bin/magento deploy:mode:set developer
  3. Delete the contents of generated code and metadata directories:
    rm -rf generated/metadata/*
    rm -rf generated/code/*

Change to default mode (recommended)

  1. Enter your public_html directory (or wherever Magento is installed)
  2. Type bin/magento deploy:mode:set default

Change to production mode

  1. Enter your public_html directory (or wherever Magento is installed)
  2. Type bin/magento deploy:mode:set production
  3. Sanity-check that your media and static symlinks are in place and working

 

  • magento, magento 2, magento mode, developer, production, default, bin/magento, cpanel, public_html
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Exception: Notice: Use of undefined constant ICONV_IMPL

Exception: Notice: Use of undefined constant ICONV_IMPLAre you experiencing this error when...

How to re-index from PHP command line using SSH

As your Magento store grows in size with more products, orders and customers, you may experience...

How to upgrade Magento 1 using SSH CLI

This is an easy and quick upgrade guide for updating Magento 1.7, 1.8 and 1.9 to Magento 1.9.x....

Efficient Magento 1 cron on CloudLinux systems

It's no secret that CloudLinux, with its CageFS and PHP selectors, cause problems running the...

How to Install RabbitMQ Server on CentOS 7

RabbitMQ is an open-source message broker, which can be used to greatly enhance the speed of...