Last updated November 21, 2015. Created on July 3, 2014.
Edited by woei, Johnnie Walker, paulmckibben. Log in to edit this page.

Configuration of multi-site on Drupal 8 is similar to previous Drupal versions. However, unlike previous versions, Drupal 8 requires multi-site to be explicitly enabled before additional sites are recognized.

Enabling multi-site with sites.php

Multi-site requires the existence of the sites.php file in the sites directory. This file does not exist by default. If this file does not yet exist, copy sites/example.sites.php as follows:

$ cp sites/example.sites.php sites/sites.php
You should edit the sites.php file for your cases, for example:

$sites = array(
'' => 'site1',
'' => 'site2'

Site directories

Each site in a multi-site installation is signified by a directory under the sites directory. Drupal is installed with a sites/default directory. Additional sites are represented by creating additional directories. For example:

  • sites/site1
  • sites/site2

Each new site directory must have a settings.php file in order for Drupal to recognize it. On initial installation of a site, copy sites/default/default.settings.php as follows:

$ cp sites/default/default.settings.php sites/[new site directory]/settings.php
$ cp sites/default/ sites/[new site directory]/services.yml
Then, you should visit the url domain and start to install a new Drupal site, for example:
Also, you should make sure your web server (nginx, apache or IIS) already finished the setting and your DNS records should be mapped ready.

Looking for support? Visit the forums, or join #drupal-support in IRC.


rhuffstedtler’s picture

I see variants of multisite/multi-site with and without the hyphen in various docs. Has the doc team set a standard for which is the proper spelling?

othermachines’s picture

However, unlike previous versions, Drupal 8 requires multisite to be explicitly enabled before additional sites are recognized.

sites.php only needs to be enabled - is that correct? As long as the site folders in sites/ follow accepted discoverability rules, nothing has to actually be set here, does it? I think this should be clarified.

tnanek’s picture

Presume this has changed, as beta-15 is lacking the file example.sites.php. I'm just not sure if that file would still be used if it were there myself, or if that was integrated elsewhere.