Magento GuideSecurity → Maintenance Mode

Magento 2 maintenance mode: how to enable/disable

There are times when you need to take your Magento store offline—like during an upgrade, extension install, or bug fix. You want customers to know it’s just temporary, and you need to avoid disruptions while you work. That’s where Magento 2’s maintenance mode comes in.

Let’s walk through exactly what it does, when to use it, and how to turn it on and off safely.

Host Magento at full throttle.

Get secure, reliable Magento hosting so you can scale faster.

What is maintenance mode in Magento 2?

Maintenance mode is a built-in Magento 2 feature that temporarily takes the storefront offline. Visitors who try to access your site will see a “Service Temporarily Unavailable” message, and Magento will send a 503 HTTP status to search engines to indicate that downtime is temporary.

Meanwhile, your team can still access the backend, if you whitelist your IP address. This makes it ideal for safe updates, configuration changes, or troubleshooting without exposing errors or broken pages to customers.

When to use Magento 2 maintenance mode

Maintenance mode is most helpful in situations where changes could break the storefront or create a bad user experience. Common examples include:

If your store is in production mode and actively serving customers, it’s best to activate maintenance mode before making backend changes.

How to enable maintenance mode in Magento 2

Magento gives you two ways to enable maintenance mode: through the command line (recommended) or by manually creating a file.

Use the Magento CLI

The easiest and most reliable way is using the bin/magento command. Here’s how:

This instantly puts the site into maintenance mode. Magento will create a .maintenance.flag file in the var directory to control this state.

Whitelist your IP address

If you need to keep working on the frontend (for example, to test pages after an update), you can allow specific IPs to bypass maintenance mode.

To enable maintenance mode and allow your own IP through:

bin/magento maintenance:enable –ip=123.123.123.123

Replace 123.123.123.123 with your real IP address.

Add more IPs by repeating the –ip flag:
bin/magento maintenance:enable –ip=123.123.123.123 –ip=124.124.124.124

You can check your current public IP address using whatismyip.com or the command line with:

curl ifconfig.me

Enable via filesystem (manual method)

If you don’t have access to Magento’s CLI—or want to enable maintenance mode using a file-based method:

This has the same effect as running the CLI command. The presence of .maintenance.flag tells Magento to show the 503 error page.

How to disable maintenance mode in Magento 2

When you’re ready to go live again, you can disable maintenance mode by removing the flag file.

Use the Magento CLI

This is the fastest method:

From your Magento root directory, run:
bin/magento maintenance:disable

This removes the .maintenance.flag file and restores normal access to the storefront.

Disable manually via filesystem

If you enabled maintenance mode by creating the file manually, you can disable it the same way:

Make sure you don’t accidentally remove the entire var/ folder—just the .maintenance.flag file.

How to check if Magento 2 is in maintenance mode

If you’re unsure whether maintenance mode is active, you can run:

bin/magento maintenance:status

This will return one of the following:

Customizing the maintenance mode page

By default, Magento displays a very plain 503 message. You can customize it to match your brand and reassure customers.

Disable manually via filesystem

You can include:

You’ll need basic knowledge of HTML/PHP to safely edit this file.

Use a custom error theme (optional)

For a fully styled maintenance page:

This is more advanced but makes your maintenance page look professional.

SEO considerations during maintenance mode

A major benefit of Magento’s maintenance mode is that it uses a 503 Service Unavailable HTTP status code. This tells search engines:

If your site shows a 404 or blank page instead, that’s a red flag to Google. You should:

For long downtimes, consider notifying Google via Search Console with temporary site messages.

Extensions for advanced maintenance mode features

Magento’s built-in maintenance mode is functional, but pretty barebones. If you want visual controls, scheduling, or rich designs, consider one of these extensions:

Maintenance Mode by Sparsh

This free module gives you an admin panel to manage:

Great for non-developers or stores that frequently update.

Mageplaza Better Maintenance

A premium option that adds:

Amasty Custom Maintenance Page

This premium extension lets you:

Automate maintenance mode in deployment scripts

If you use a CI/CD workflow (like GitHub Actions or Bitbucket Pipelines), you can include maintenance mode in your deployment steps.

Example Bash snippet:

bin/magento maintenance:enable –ip=YOUR.IP.ADDRESS

deploy scripts here (code pull, composer update, etc.)

bin/magento maintenance:disable

Why automate?

Magento maintenance mode FAQs

The fastest way is:

bin/magento maintenance:enable

To whitelist your IP, add –ip=your.ip.address. You can also manually create the file var/.maintenance.flag.

Magento 2 has:

Maintenance mode is separate and can be used in any of these modes, though it’s most common in production.

Maintenance mode is a temporary state where your Magento store blocks access to the frontend and displays a 503 error message. It lets admins work safely behind the scenes.

It means the site is undergoing updates or fixes. Visitors are told the site is temporarily unavailable, while admins or developers still have access—often limited to specific IPs.

Next steps for managing Magento 2 maintenance mode

Magento 2’s maintenance mode gives you a safe way to update your site without disrupting customers or hurting SEO. Whether you’re running updates, fixing bugs, or just prepping for a relaunch, it’s one of the most important tools in your Magento toolkit.

Start by learning the CLI commands, set up IP whitelisting for your team, and consider adding a custom message or extension for a better user experience.

Ready to upgrade your Magento experience? Professional hosting improves speeds, security, and reliability for a website and a brand that people find engaging and trustworthy.

Liquid Web offers the raw infrastructure power you need with mission-critical features that keep your store running smoothly. Most importantly, our in-house Magento experts are standing by to help with both hosting and Magento application roadblocks.

Click through below to explore all of our Magento hosting options, or chat with an expert right now to get answers and advice.

Ready to get started?

Get the fastest, most secure Magento hosting on the market

Additional resources

What is Magento Ecommerce? →

A complete beginner’s guide to the Magento Ecommerce platform

Magento security patch: What it is and how to install it →

Understand how to apply Magento security patches to keep your store protected from vulnerabilities and threats.

Best Magento ERP extensions →

Our top 10 compared so you can decide which is best for your business