I am not able to set Maintenance Mode in 2.0 version. Can someone tell me the steps that how to manage maintenance mode with magento 2.0?

4 Answers 4


In order to put your Magento 2 store in maintenance mode, you need to create one .maintenance.flag file and upload it under var folder at root of your Magento 2 installation.

If var/.maintenance.flag does not exist, Magento operates normally, and maintenance mode is off.

Alternatively, you can run below on your magento root shell:

# Enable maintenance mode
bin/magento maintenance:enable

# If you need to whitelist your IPs
bin/magento maintenance:enable --ip=X1.X1.X1.X1 --ip=X2.X2.X2.X2

# Disable maintenance mode
bin/magento maintenance:disable

To enable maintenance mode you should create var/.maintenance.ip file. This file can contain a list of IP addresses. If an entry point is accessed using HTTP and the client IP address corresponds to one of the entries in that list, then maintenance mode is off.

Command usage::

bin/magento maintenance:enable
bin/magento maintenance:disable

To enable maintenance mode for all clients except and

bin/magento maintenance:enable --ip= --ip=

Read more here


You can enable disable maintenance mode and exempt IP-addresses enable disable for using below command.

Maintenance mode Enable:

php bin/magento maintenance:enable

Maintenance mode Disable:

php bin/magento maintenance:disable

Maintenance mode Enable List of exempt IP-addresses

php bin/magento maintenance:enable --ip= --ip=

Maintenance mode remove List of exempt IP-addresses

php bin/magento maintenance:disable --ip=none

Hope it help!

bin/magento maintenance:enable

...but...remember to purge varnish imediately after setting maintenance:enable, otherwise the pages will still be served from cache. Simplest way is service restart varnish

Then you can add IPs (e.g. admin's) that elide maintenance page: bin/magento maintenance:allow-ips

Clear the list with bin/magento maintenance:allow-ips --none

Finally, bin/magento maintenance:disable

Not the answer you're looking for? Browse other questions tagged or ask your own question.