Other Applications
How to enable the Maintenance mode in Magento?

How to enable the Maintenance mode in Magento?

This article explains how to put your Magento online store in maintenance mode so your visitors know that you’re working on your website. To put a Magento site in maintenance mode, you need to create an empty .maintenance.flag file and upload it to the var/ folder of your site. Make sure not to miss the dot in front of the filename.

Note that once you enable maintenance mode, you won’t be able to access both the front and backend of your website. In case you want to access the website while in maintenance mode, you will need to add a .maintenance.ip file in the var/ folder. The file should contain the IP address from which the website should be accessed. Thus only when visited from that IP address, the website will not show the maintenance page.

When you decide to disable the maintenance mode – just remove the .maintenance.flag and .maintenance.ip files.

Another option to enable maintenance mode is by logging via SSH  and running the following command:

php bin/magento maintenance:enable --ip=

The IP address acts as a variable here and you should make sure to substitute it with your IP address.

You may also disable it via a similar command which is as follows:

php bin/magento maintenance:disable

Share This Article