Add custom maintenance page in Magento 2

Creating a custom page is optional but recommended because the site is accessible during part of the upgrade. This will prevent users from any access to the site and also informs that the site is undergoing maintenance



Go into the pub/errors
Create a copy of the local.xml.sample and rename it as local.xml
Edit the <skin> with your custom name. Ex – bondi

<?xml version="1.0"?>


Next create a copy of the default” folder and rename it with your skin name. Ex – bondi


Locate the 503.phtml inside the newly created folder and add your custom code. Add the styles inside css/styles.css and relevant images under images folder.


Refresh the page to see the changes

*Maintenance mode should be enabled

Use these commands to enable and disable the maintenance mode

php bin/magento maintenance:enable
php bin/magento maintenance:dis

To enable maintenance mode for all clients except chosen IP address,

php bin/magento maintenance:enable --ip=[ip address]
php bin/magento maintenance:enable --ip=

To check the status,

php bin/magento maintenance:status


Senior Tech Lead at Netstarter PTY ltd. Magento Certified Front End Developer, Certified ScrumMaster, Microsoft Certified Professional, Member of British Computer Society

Leave a Reply

  • (will not be published)