How to Set Production Mode in Magento 2

Show current Magento 2 Mode

Run the following command to show the current mode:

php bin/magento deploy:mode:show

Currently, we are in default mode. We can set to Production mode

Set Production Mode

Run the following command to set the production mode:

$ php bin/magento deploy:mode:set production
Enabled production mode.

Now you are in production mode.