How to Enable/Disable Maintenance Mode in Magento 2

Enable/Disable Maintenance Mode in Magento 2

Do you want to enable or disable maintenance mode in Magento 2 store?

In this tutorial we are going to show you how to enable or disable maintenance mode in Magento 2, This article will guide you quickly enable or disable maintenance mode in Magento 2 step by step.

If var/.maintenance.flag does not exist, Magento operates normally, and maintenance mode is off.  Once you upload .maintenance.flag file to var folder, maintenance mode is on. But still, you need to verify var/.maintenance.ip file because it contains the list of the IPs that granted access to the website.

Let’s start!

First of all, you need login SSH to your account.

Check Maintenance Mode Status

You can check the maintenance mode by going to your Magento’s directory and run this command:

php bin/magento maintenance:status

This command allows you to check the maintenance mode status.

Enable Maintenance Mode

You can enable the maintenance mode by running this command:

php bin/magento maintenance:enable

This command allows you to enable the maintenance mode.

Enable Maintenance Mode(ip/ips)

If you want to set the maintenance flag for everyone, except one ip/ips, you need to run the command:

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

So everyone, except those 2 ips, will see the maintenance mode enabled.

Disable Maintenance Mode

You can disable the maintenance mode by running this command:

php bin/magento maintenance:disable
How to Enable/Disable Maintenance Mode in Magento 2 Click To Tweet

We hope this article helped you learn how to enable or disable maintenance mode in Magento 2. You may also want to see our list of 10 Best Magento 2 SEO Extensions for Higher Rankings.

If you liked this article, then please subscribe to our Newsletter for Magento tutorials. You can also find us on Twitter and Facebook. If you have any problem or would like to add to the discussion, leave a comment below!

You May Also Like

Editorial Staff

About the Author: Editorial Staff

Editorial Staff at the MageBeginners is a team of Magento experts writing about Magento Tutorials, Themes, Extensions, Guides, Tricks and much more...

Leave a Reply

Your email address will not be published. Required fields are marked *