[[extend-maintenance]]

=== Enabling and Disabling Maintenance Mode

[role="summary"]
How to enable maintenance mode to set up a "Site under maintenance" message, and how to disable it.

(((Maintenance mode,overview)))
(((Maintenance mode,enabling)))
(((Maintenance mode,disabling)))

==== Goal

Put your site in maintenance mode to allow users with the right permissions to
use the site while users without this permission are presented with a message
that the site is under maintenance.

==== Prerequisite knowledge

<<security-concept>>

==== Site prerequisites

If you want to use Drush to enable or disable maintenance mode, Drush must be
installed. See <<install-tools>>.

==== Steps

You can use the administrative interface or Drush to enable or disable
maintenance mode.

===== Enabling maintenance mode using the administrative interface

. In the _Manage_ administrative menu, navigate to _Configuration_ >
_Development_ > _Maintenance mode_ (_admin/config/development/maintenance_). The
_Maintenance mode_ page appears.

. Fill in the fields as shown below.
+
[width="100%",frame="topbot",options="header"]
|================================
|Field name | Explanation | Value

| Put site into maintenance mode | Enable the maintenance mode |
Checked

| Message to display when in maintenance mode | The information that is shown to
website visitors when the mode is enabled. Variables such as @site can be used
in the message |@site is currently under maintenance but should be back
shortly. Thank you for your patience.

|================================

. Click _Save configuration_.

. Verify that the site is in maintenance mode by accessing it from another
browser where you aren't logged in. If you are not able to verify, try clearing
the cache. See <<prevent-cache-clear>>.
+
--
// Site in maintenance mode.
image:images/extend-maintenance-mode-enabled.png["Maintenance mode enabled",width="100%"]
--

===== Disabling maintenance mode using the administrative interface

. In the _Manage_ administrative menu, navigate to _Configuration_ >
_Development_ > _Maintenance mode_ (_admin/config/development/maintenance_). The
_Maintenance mode_ page appears.

. Fill in the fields as shown below.
+
[width="100%",frame="topbot",options="header"]
|================================
|Field name | Explanation | Value

| Put site into maintenance mode | Disable the maintenance mode |
Unchecked

| Message to display when in maintenance mode | No message required while disabling. You can leave the field blank. |

|================================

. Click _Save configuration_.

. Verify that the site is no longer in maintenance mode by accessing it from
another browser where you aren't logged in. If you are not able to verify, try
clearing the cache. See <<prevent-cache-clear>>.
+
--
// Site no longer in maintenance mode.
image:images/extend-maintenance-mode-disabled.png["Maintenance mode disabled",width="100%"]
--

===== Enabling or disabling maintenance mode using Drush

. Follow the user interface steps above to edit the site maintenance message, if
desired.

. Run the following Drush commands to enable maintenance mode and clear the
cache:
+
----
drush sset system.maintenance_mode 1
drush cr
----

. Run the following Drush commands to disable maintenance mode and clear the
cache:
+
----
drush sset system.maintenance_mode 0
drush cr
----

. After running either set of commands, verify that your site is either in or
out of maintenance mode by visiting the site in a browser where you are not
logged in.

==== Expand your understanding

* <<security-update-core>>

* <<security-update-theme>>

* <<security-update-module>>

//==== Related concepts

==== Videos

// Video from Drupalize.Me.
video::https://www.youtube-nocookie.com/embed/IQbqQs5h03Q[title="Enabling and Disabling Maintenance Mode"]

// ==== Additional resources


*Attributions*

Written and edited by https://www.drupal.org/u/batigolix[Boris Doesborg],
https://www.drupal.org/u/jojyja[Jojy Alphonso] at
http://redcrackle.com[Red Crackle], and
https://www.drupal.org/u/jhodgdon[Jennifer Hodgdon].
