Magento 2 Enable or Disable maintenance mode via Command Line
In this tutorial, we will talk about Enable Magento 2 (Adobe Commerce) maintenance mode via Command Line in Command Line Series. As you know, from Magento 2, they add many commands in
bin/magento. If you are having issues with enabling or disabling maintenance mode, this post might help. You will be guided on how to do that programmatically by running simple command lines.
It’s easy to follow. I’m sure that you can do it right away and get the results.
Check maintenance mode Status in Magento 2
php bin/magento maintenance:status
Status: maintenance mode is not active List of exempt IP-addresses: 126.96.36.199
Enable Magento 2 Maintenance Mode via command line
php bin/magento maintenance:enable
$ php bin/magento maintenance:enable Enabled maintenance mode
Disable Magento 2 maintenance mode via command line
php bin/magento maintenance:disable
Allow IPs to access to the store
Sets maintenance mode exempt IPs
php bin/magento maintenance:allow-ips
php bin/magento maintenance:allow-ips 188.8.131.52 Set exempt IP-addresses: 184.108.40.206
Upgrade your Magento 2 store to the latest version for new features and security - with the help of our dedicated experts.Upgrade now
I hope that this is a useful post for you about how to enable or disable maintenance mode via command lines.
Thank you for reading!
- How to create a simple Hello World module for Magento 2
- Magento 2 Block Template Ultimate Guides
- How to Create Module in Magento 2
- How to Create Controller in Magento 2
- How to create CRUD Models in Magento 2
- View: Layouts, Block and Templates
- Configuration - System.xml
- How To Create Admin Menu In Magento 2
- Admin ACL
Enjoyed the tutorial? Spread it to your friends!
Sam is the CEO and Founder of Mageplaza, pursuing a simple and healthy lifestyle. He is a friend, a husband, and a father to two children. As a trainer and an aspiring influencer, he is also a big fan of sports and travel. Sam is exceptionally knowledgeable about e-commerce, especially Magento and Shopify, with 10 years of experience in the field.