Enable or Disable Magento 2 Maintenance Mode using CLI / Command Prompt or Files
What is the magento maintenance mode ?When Magento is in maintenance mode, visitors see a Service Temporarily Unavailable message in their web browsers instead of the store. However, authorized IP addresses can still view the store normally.You can enable maintenance mode using two methods.How to en...
What is the magento maintenance mode ?
When Magento is in maintenance mode, visitors see a Service Temporarily Unavailable message in their web browsers instead of the store. However, authorized IP addresses can still view the store normally.
You can enable maintenance mode using two methods.
How to enable magento maintenance mode using cli / command prompt / terminal.
Login to your server using SSH or terminal that is available to you.
change the directory to your Magento store root folder
Then type in the below command and press enter to enable the maintenance mode for everyone.
bin/magento maintenance:enable
Now everyone visiting the website will see a Service Temporarily Unavailable message like below.
How to enable magento maintenance mode for everyone except few IP addresses ( or yourself)
You can also enable the maintenance mode for everyone except a few known IP addresses. This option is useful for fixing a bug on a live website. Using this method a developer/admin can view the Magento website while other people will see a site under maintenance banner.
1st find out your computers IP address. Easiest way is to go to Chrome and search for "What is my IP address" : click here to search
Now enter below command with your IP address like below .
bin/magento maintenance:enable --ip xxx.xxx.xxx.xxx
The magento website will be now under maintenance mode except for the specified IP.
How to disable Magento maintenance mode using CLI / Command Prompt / Terminal
Login to your server using SSH or terminal that is available to you.
change the directory to your Magento store root folder
Then type in the below command and press enter to enable the maintenance mode for everyone.
bin/magento maintenance:disable
Now the Magento "Service Temporarily Unavailable" message will be gone and the normal website will be shown.
How to enable/disable Magento maintenance mode file "maintenance.flag"
If you dont have access to SSH terminal, still you can enable magento maintenance mode by creating a blank file named "maintenance.flag" under the magento root folder using a FTP client.
To disable magento maintenance mode , delete the file "maintenance.flag" under your magento root folder.
Related Articles
WP E-commerce Trends: Sri Lankan Exports 2026
Discover the top 2026 WordPress e-commerce trends for Sri Lankan SMBs exporting globally. Boost sales with AI, AR, and sustainable practices.
Mastering E-Commerce in Sri Lanka: The Definitive Business Guide for 2026
The digital marketplace has fundamentally reshaped how Sri Lankan enterprises connect with customers both locally and globally. As we navigate through 2026, e-commerce has evolved from a supplementary sales channel into the primary engine driving business growth across the nation. With Sri Lanka's e...
Emerging Client Needs: Localized Payments for Sri Lankan DTC Brands Using FriMi and Dialog Axiata
The Rise of Sri Lankan DTC and the Local Payment Gap
Multi-Currency WooCommerce for Sri Lankan SMEs | Cross-Border Trade
The Global Opportunity: Why Multi-Currency is a Game-Changer for Sri Lankan SMEs