Cookies setting

Cookies help us enhance your experience on our site by storing information about your preferences and interactions. You can customize your cookie settings by choosing which cookies to allow. Please note that disabling certain cookies might impact the functionality and features of our services, such as personalized content and suggestions. Cookie Policy

Cookie Policy
Essential cookies

These cookies are strictly necessary for the site to work and may not be disabled.

Information
Always enabled
Advertising cookies

Advertising cookies deliver ads relevant to your interests, limit ad frequency, and measure ad effectiveness.

Information
Analytics cookies

Analytics cookies collect information and report website usage statistics without personally identifying individual visitors to Google.

Information
mageplaza.com

Magento 2 Enable or Disable maintenance mode via Command Line

Vinh Jacker | 12-18-2024

Enable or Disable maintenance mode

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.

Let’s start!

Custom Maintenance Page with FREE extension

Check maintenance mode Status in Magento 2

 php bin/magento maintenance:status

Result:

Status: maintenance mode is not active
List of exempt IP-addresses: 123.123.123.123

Enable Magento 2 Maintenance Mode via command line

php bin/magento maintenance:enable

Result:

$ 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

E.g:

php bin/magento maintenance:allow-ips 168.168.168.168
Set exempt IP-addresses: 168.168.168.168

Looking for
Upgrade Services?

Upgrade your Magento 2 store to the latest version for new features and security - with the help of our dedicated experts.

Upgrade now
upgrade service

That’s all!

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!

x
    Jacker

    With over a decade of experience crafting innovative tech solutions for ecommerce businesses built on Magento, Jacker is the mastermind behind our secure and well-functioned extensions. With his expertise in building user-friendly interfaces and robust back-end systems, Mageplaza was able to deliver exceptional Magento solutions and services for over 122K+ customers around the world.



    Related Post

    Website Support
    & Maintenance Services

    Make sure your store is not only in good shape but also thriving with a professional team yet at an affordable price.

    Get Started
    mageplaza services