What is maintenance mode?
Magento is a free tool for building online shops. Maintenance mode is like a "Closed" sign on a shop door. Visitors see a short message instead of your shop. You can then update or fix things in peace.
This guide works for Magento 1.x, which is old software. Newer versions use a command instead (shown below). The idea is the same.
Before you start
Take a backup. If you will leave the shop closed for a long time, tell your customers first.
Magento 1.x: turn it on
- Open File Manager in your hosting control panel.
- Go to the folder where Magento is installed. This is the folder that holds
index.php. - Click + File to make a new file.
- Name it
maintenance.flag. - Click Create New File.
- Open your shop in a new tab. You should see the maintenance page.
The file can be empty. Magento only checks whether it exists.
Magento 1.x: turn it off
- Open File Manager and go to the same folder.
- Click
maintenance.flagto select it. - Click Delete. Delete only this file. It holds no data.
- Refresh your shop. It should be back to normal.
Magento 2: use the command line
This needs SSH, which is a way to type commands on your server. Ask Hostvento support if SSH is on your plan. Go to your Magento folder and type:
php bin/magento maintenance:enable
This turns maintenance mode on. To turn it off, type:
php bin/magento maintenance:disable
This puts your shop back online.
Let your own computer in
In Magento 2 you can allow one address, so you can test while others see the closed sign:
php bin/magento maintenance:allow-ips 203.0.113.5
This lets the address 203.0.113.5 see the real shop. Use your own IP address instead. An IP address is the number that identifies your internet connection.
Quick recap
- Maintenance mode shows a closed sign to visitors.
- In Magento 1.x, create
maintenance.flagto turn it on and delete it to turn it off. - In Magento 2, use
maintenance:enableandmaintenance:disable.