How to Set Maintenance mode in Magento2

Whenever we upgrade very large scale of integration into production we may have to make site as maintenance mode for some time. So that the customer can get the alert when they visit the website. For that magento2 is providing some commands to make site as Maintenance mode & we will also revert once deployment is done.
Enable Maintenance Mode:
To enable the maintenance mode execute below command in root of the magento installation. This command will enable the maintenance mode in a website Once enable is done then the frontend customer will get “Service Temporarily Unavailable” page. This page is available from pub/errors/default/503.phtml.
root>php bin/magento maintenance:enable
Disable Maintenance Mode:
To disable the maintenance mode execute below command in root of the magento installation. This command will disable or revert the maintenance mode in a website
root>php bin/magento maintenance:disable
Status of the Maintenance Mode:
To validate the Maintenance mode we have to use below command.
root>php bin/magento maintenance:status
Exclude IP bases Maintenance Mode:
This command will mostly helpful for the development team. If development team wants to access the team before make site is up to customer development team can validate there updated module/change status.Mentioned IP people can able to view the site.
root>php bin/magento maintenance:enable --ip=<IP 1> --ip=<IP 2>

“Don’t Drink and Drive!!!”

Leave a Reply