Multisite

Multisite is a Drupal feature that runs independent sites, each with its own database, configuration and files, from one shared codebase.

Вивчення DrupalГлосарій Drupal Last updated

Multisite is a way to host more than one Drupal website from a single Drupal installation. You install core, modules and themes once, then add a folder under sites for each extra site. Which folder answers a request depends on the address that was asked for.

How multisite works in Drupal 11

The Drupal.org multisite documentation, written for Drupal 8 and later, describes the sites as separate and independent, each with its own database, configuration, files and base domain or URL.

Three pieces of core 11.4.10 make it work:

  • sites/sites.php. The file switches the feature on. Core's INSTALL.txt tells you to copy example.sites.php to that name. Without it, DrupalKernel::findSitePath() always returns sites/default.
  • One folder per site. Each extra site gets a subfolder of sites with its own settings.php. The easiest start, according to INSTALL.txt, is to copy default.settings.php from sites/default.
  • Site-specific code. A site folder can hold its own modules and themes directories next to the shared modules and themes in the web root. Code in a site folder is not available to the other sites.

Install profiles work the other way round. The README in the web root's profiles directory says profiles placed there are available to every site during its first installation, so each site can start from a different install profile.

Folder names come from the site's address. INSTALL.txt says to leave out www. if visitors can reach the site without it. A port counts as the deepest subdomain, so http://www.example.com:8080/ can load from sites/8080.www.example.com/. A path becomes a dot-separated suffix, as in sites/sub.example.com.site3.

Example

Three sites share one codebase:

sites/sites.php
        sites/default/settings.php
        sites/example.com/settings.php
        sites/sub.example.com.site3/settings.php

For the request www.sub.example.com/site3, INSTALL.txt says Drupal checks the folders in this order and uses the first one that has a settings.php:

sites/www.sub.example.com.site3
        sites/sub.example.com.site3
        sites/example.com.site3
        sites/www.sub.example.com
        sites/sub.example.com
        sites/example.com
        sites/default

Here the second entry matches, so the request is served by the site3 site.

Common mistakes

  • Leaving trusted_host_patterns too narrow. The comments in default.settings.php say that on a multisite you should list every host pattern the sites use.
  • Running Drush without --uri. The command then runs against the default site, not the one you meant.
  • Expecting one configuration export for all sites. Databases are separate, so each site needs its own configuration export and import.

For marketing and content teams

With multisite, brands or country sites can look and behave differently while one development team maintains the code. The trade-off is the shared codebase: when your developer updates a module through Composer, the new code reaches every site in that installation. Ask which sites share a codebase before you request a feature that only one of them needs.

Sources

Questions about Drupal multisite

Yes. Core's INSTALL.txt says the file sites/sites.php must exist, and you create it by copying example.sites.php. In Drupal 11.4.10, DrupalKernel::findSitePath() returns sites/default straight away when that file is missing, so extra site folders are never looked at.

No. The Drupal.org documentation says each site has its own database, configuration and files; only the codebase is shared. Content, users and configuration therefore stay separate unless your developer builds a deliberate connection between them.

Pass the site address with the --uri option, or -l for short. The Drush documentation describes it as a base URL for building links and selecting a multi-site, with a default of https://default. Example: drush --uri=https://sub.example.com config:export.

Yes, with an alias in sites/sites.php. Its $sites array maps a key such as dev.drupal.org to a folder name such as example.com, using the format port, domain and path joined by dots. Core's example.sites.php lists several examples.

Cite this definition

"Multisite." DXPR Drupal glossary, https://dxpr.com/hc/documentation/learn-drupal/drupal-glossary/multisite. Last updated October 26, 2026.

Related terms

All Drupal terms from A to Z