contao:maintenance-mode

Info

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.
Note

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

Tip

Instead of using the command to disable the global maintenance mode you can also manually delete the file var/maintenance.html in your Contao instance. This might be useful in case the console command fails for whatever reason.