contao:maintenance-mode

This feature is available in Contao 4.13 and later.

The maintenance mode has been rewritten for this Contao version. Via the command line, the complete Contao installation (back- and front end) can be put into maintenance mode. This feature is very useful if you want to update your system.

Furthermore you have the possibility to set the front end for each website root into maintenance mode.

php vendor/bin/contao-console contao:maintenance-mode [options] [<state>]
OptionDescription
--template=TEMPLATEAllows the use of a different Twig template name when maintenance mode is enabled. Default is @ContaoCore/Error/service_unavailable.html.twig
--templateVars[=TEMPLATEVARS]Add custom template variables to the Twig template when maintenance mode is enabled (deploy as JSON). Default is {}

 

StateDescription
enable or onEnables the Contao installation into maintenance mode.
disable or offDisables the maintenance mode for the Contao installation.

You can learn how to customize the maintenance template in our tutorial.