What is the magento maintenance mode ?
When Magento is in maintenance mode, visitors see a Service Temporarily Unavailable message in their web browsers instead of the store. However, authorized IP addresses can still view the store normally.
You can enable maintenance mode using two methods.
How to enable magento maintenance mode using cli / command prompt / terminal.
Login to your server using SSH or terminal that is available to you.
change the directory to your Magento store root folder
Then type in the below command and press enter to enable the maintenance mode for everyone.
bin/magento maintenance:enable
Now everyone visiting the website will see a Service Temporarily Unavailable message like below.
How to enable magento maintenance mode for everyone except few IP addresses ( or yourself)
You can also enable the maintenance mode for everyone except a few known IP addresses. This option is useful for fixing a bug on a live website. Using this method a developer/admin can view the Magento website while other people will see a site under maintenance banner.
1st find out your computers IP address. Easiest way is to go to Chrome and search for “What is my IP address” : click here to search
Now enter below command with your IP address like below .
bin/magento maintenance:enable --ip xxx.xxx.xxx.xxx
The magento website will be now under maintenance mode except for the specified IP.
How to disable Magento maintenance mode using CLI / Command Prompt / Terminal
Login to your server using SSH or terminal that is available to you.
change the directory to your Magento store root folder
Then type in the below command and press enter to enable the maintenance mode for everyone.
bin/magento maintenance:disable
Now the Magento “Service Temporarily Unavailable” message will be gone and the normal website will be shown.
How to enable/disable Magento maintenance mode file “maintenance.flag”
If you dont have access to SSH terminal, still you can enable magento maintenance mode by creating a blank file named “maintenance.flag” under the magento root folder using a FTP client.
To disable magento maintenance mode , delete the file “maintenance.flag” under your magento root folder.