[[extend-theme-install]]

=== Downloading and Installing a Theme from _Drupal.org_

[role="summary"]
How to download and install a theme from Drupal.org or by using Drush.

(((Theme,downloading)))
(((Theme,installing)))
(((Theme,enabling)))
(((Theme,contributed)))
(((Theme,custom)))
(((Contributed theme,downloading)))
(((Contributed theme,installing)))
(((Contributed theme,enabling)))
(((Custom theme,installing)))
(((Custom theme,enabling)))
(((Downloading,theme)))
(((Installing,theme)))
(((Enabling,theme)))
(((Update Manager module,using to install theme)))
(((Module,Update Manager)))
(((Drush tool,using to install theme)))
(((Drupal.org website,downloading and installing theme from)))

==== Goal

Download and install a theme from _Drupal.org_.

==== Prerequisite knowledge

* <<extend-theme-find>>
* <<install-tools>>

==== Site prerequisites

If you want to install via the website, the core Update Manager module must be
installed. See <<config-install>> for instructions on installing modules.

If you want to use Drush, Drush must be installed. See <<install-tools>>.

==== Steps

You can use the administrative interface to download and install a contributed
theme. If you are installing a custom theme rather than a contributed theme, if
you see a message saying _Installing modules and themes requires FTP access to
your server_, or if the steps below do not work to download and unpack the theme
files, follow the steps in <<extend-manual-install>>. If you are using Composer
to manage the files in your site, follow the steps for downloading in
<<install-composer>>. In either of these cases, you can then install the theme
using Drush, or by continuing with step 7 in the instructions for the
administrative interface below.

===== Using the administrative interface

. On the theme's project page on drupal.org (for example,
_https://www.drupal.org/project/mayo_), scroll to the _Downloads_ section
at the bottom of the page.

. Right-click _tar.gz_ to copy the address.
+
--
// Downloads section of the Mayo project page on drupal.org.
image:images/extend-theme-install-download.png["Finding the URL for a theme"]
--

. In the _Manage_ administrative menu, navigate to _Appearance_
(_admin/appearance_). The _Appearance_ page appears.

. Click _Install new theme_. The _Install new theme_ page appears.
+
--
// Install new theme page (admin/theme/install).
image:images/extend-theme-install-page.png["Installing a theme"]
--

. In the field _Install from a URL_, paste the copied download link. This value
could look like
`https://ftp.drupal.org/files/projects/mayo-8.x-1.3.tar.gz`.

. Click _Install_ to upload and unpack the new theme on the server. The files
are being downloaded to the _themes_ directory.

. Click _Install newly added themes_ to return to the _Appearance_ page. If you
used the manual uploading procedure mentioned earlier, then you can continue
with this step, and reach the _Appearance_ page by using the _Manage_
administrative menu and navigating to _Appearance_ (_admin/appearance_).

. Locate the new theme under _Uninstalled themes_ and click _Install and set as
default_ to use it. All non-administrative pages on the site will now use this
new theme.
+
--
// Mayo theme on the Appearance page.
image:images/extend-theme-install-appearance-page.png["Uninstalled themes on Appearance page",width="286px"]
--

===== Using Drush to install a theme

. Find the project name for the theme you want to install, which is the last
segment of the theme's project page URL. For example, if the project URL is
_https://www.drupal.org/project/mayo_, the project name is `mayo`.

. Download the theme using either the steps in <<extend-manual-install>> or
<<install-composer>>.

. Run the following Drush commands, giving the project name (for example,
_mayo_) as a parameter:
+
----
drush en mayo
drush config-set system.theme default mayo
----

. Follow the instructions on the screen.

==== Expand your understanding

* In the _Manage_ administrative menu, navigate to _Appearance_
(_admin/appearance_) and uninstall any themes that you are not using.

* <<extend-module-find>>

* <<extend-module-install>>

* If you do not see the effect of these changes in your site, you might need
to clear the cache. See <<prevent-cache-clear>>.


// ==== Related concepts

==== Videos

// Video from Drupalize.Me.
video::https://www.youtube-nocookie.com/embed/UOYy9A_9_Lw[title="Downloading and Installing a Theme from Drupal.org"]

//==== Additional resources


*Attributions*

Written and edited by https://www.drupal.org/u/eojthebrave[Joe Shindelar] at
https://drupalize.me[Drupalize.Me], and
https://www.drupal.org/u/batigolix[Boris Doesborgh].
