Magento 2 Maintenance Mode - Enable/Disable/Status
Magento 2 provide simple CLI (Command Line Interface) for manage maintenance mode.
Enable maintenance mode:
bin/magento maintenance:enable
Disable maintenance mode:
bin/magento maintenance:disable
Allow access only for specified IPs:
bin/magento maintenance:allow-ips 127.0.0.1,127.0.0.2
Check maintenance mode status:
bin/magento maintenance:status
When you enable maintenance mode, magento creates file [magento_home_directory]/var/.maintenance.flag
. For disable maintenance mode, you can just remove this file.