Magento Modes
Magento 2 has three modes which the software can be run in that affect the performance and how you can interact with the software:
- Default
- Developer
- Production
Production Performance
As its name suggest this is the mode Magento 2 should be run in when a site is production (running on a live environment / server).
Developer Delight
Again, as its name suggests, developer mode is optimised for development, trading the performance benefits seen in production mode for the ability to easily and quickly see changes made within the codebase.
Don't be a default!
Default mode, as its name suggests, is the default mode enabled whenever you setup a new instance of the Magento 2 software.
It's neither optimal for developer or production and it's purpose is to facilitate DIY merchants and shared hosting environments / one-click-installs.
Don't use!
Check the current mode
To view the currently set mode simply run the below from your Magento root directory:
$ bin/magento deploy:mode:show
This should return a message like the below:
> Current application mode: default. (Note: Environment variables may override this value.)
Switch to developer mode
To switch to developer mode simply run the below from your Magento root directory:
$ bin/magento deploy:mode:set developer
This should return a message like the below:
> Enabled developer mode.
Test out production mode
To switch to developer mode simply run the below from your Magento root directory:
$ bin/magento deploy:mode:set production
This time, rather than just return a simple message stating we've switched mode, you'll notice changing to production mode kicks off a chain of further processes.