Maintenance mode is the essential mode in Magento 2 and it’s vital to know how to enable and disable them. If you want to disable your website to upgrade or fix a bug for a moment, then you should give your website to maintenance mode.
The important notes are:
- First the mode is off, if the file var/.maintenance.flag dos not exist.
- If var/maintainace.flag exists, the mode is on. But it also depends on the file var/maintenance.ip. This file will make some exception so the Magnento 2 maintenance mode can be off even if the var/maintenance.flag
Steps To Enable and Disable Maintenance Mode In Magento 2
The command line to execute the Maintenance mode are listed:
php bin/magento maintenance:enable [--ip=<ip address>]
php bin/magento maintenance:enable --ip=192.168.1.10 --ip=192.168.1.11
You will be enable or disable the maintenance mode by these two IP address .This will happen usually when the IP address of the developer who want to debug your websites.
- To disable the maintenance mode
php bin/magento maintenance:disable [--ip=<ip address>]
- To show status
php bin/magento maintenance:status
The exempt IP address from maintenance mode:
php bin/magento maintenance:allow-ips <ip address> .. <ip address> [--none]
The above-mentioned steps are the important process for you to manage to run enable or disable the maintenance mode in Magento 2 easily. Each store in Magento has several elements.
Get build your Magento store with the latest version to scale your eCommerce business further.