Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk12 min

How to Run Multiple Sites on One Drupal Installation

A practical Drupal multisite guide covering directory layout, databases, sites.php aliases, virtual hosts, trusted hosts, installation, isolation and operational trade-offs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Drupal multisite: one shared Drupal codebase and document root, with a separate site directory, settings.php, database and files for each site. Map every hostname or path in sites/sites.php, point every virtual host to the shared root, configure trusted hosts, and run the installer for each site.

What Drupal multisite is

Drupal multisite lets one Drupal codebase serve several independent Drupal sites. The code, core libraries and commonly used modules and themes are shared, while each site keeps its own configuration, database and files. Drupal’s documentation describes the model as one installation hosting several Drupal-powered sites, with each site having its own database, configuration, files and base domain or URL.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This is different from putting several domains into one Drupal site. In a multisite installation, each site has its own administrative configuration and content store. A change made in one site’s content or settings does not automatically appear in another site.

Layer Shared across sites Kept per site
Drupal code Core, shared libraries and extensions installed in common locations Site-local modules or themes when a site needs an exception
Configuration Common code defaults and deployment process settings.php and Drupal configuration stored for that site
Content and users Nothing by default Each site’s database, including its content and user records
Uploaded files Filesystem infrastructure can be shared Each site’s public and private files should be in its own site directory
Domains The same web-server document root Each hostname, subdomain or path used to select a site

Drupal core does not publish a universal maximum number of sites for multisite. The practical limit depends on database capacity, storage, traffic, deployment discipline and the resources available to maintain every site.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

When multisite is the right architecture

Choose core multisite when sites should be operationally separate: separate databases, independent content and configuration, separate file trees and potentially different administrators. It is useful for a group of unrelated sites that share a release process or for organizations that want one maintained codebase without combining the sites’ data.

Do not choose it merely because several domains are involved. If the domains should share content types, users, authentication or domain-aware permissions, evaluate a single Drupal site with the Domain Access project instead. Core multisite does not provide shared content or single sign-on between its databases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Plan the installation before creating sites

Choose one shared document root

Install Drupal once in a document root that every site will use. The web server’s document root is the Drupal codebase; it is not a site-specific directory. A typical layout looks like this:

/var/www/drupal/                 shared document root
  core/
  modules/
  themes/
  sites/
    default/
      settings.php                root or default site
      files/
    site1.example.com/
      settings.php
      files/
    site2.example.com/
      settings.php
      files/
    sites.php

The directory names are examples. They must match the aliases and hostname discovery rules you configure.

Prepare DNS and virtual hosts

Every hostname must resolve in DNS and be routed by Apache, Nginx or another supported web server to the same Drupal document root. A virtual host or server block for site1.example.com must therefore point to the shared Drupal root, not to /var/www/drupal/sites/site1.example.com. The latter is a configuration and files directory, not a separate web root.

Prepare databases and permissions

Create a database and a database account for each independent site. Ensure the web-server user can read the code and write only where Drupal requires it, including that site’s files directory and any settings files that must be updated during installation. Record the database name, host, port, username, password and driver details for each site before starting the installer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Decide how domains will be used

Multisite can select a site from separate domains, subdomains or subdirectories. Decide the production hostname and any development hostname for every site. If development and production names differ, use an explicit alias in sites/sites.php rather than renaming directories every time a site moves between environments.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Step-by-step: add a site to the shared Drupal installation

1. Install the supported Drupal version once

Install the supported Drupal release in the shared document root. Complete the first site’s database setup and confirm that its virtual host serves Drupal normally. This establishes the codebase that subsequent sites will reuse.

2. Create the new site directory

For a site whose production hostname is site1.example.com, create:

sites/site1.example.com/

The directory name is normally the hostname, but it can be any valid configuration-directory name if you map it with an alias. Keep the directory separate from other sites so settings and uploads cannot be mixed accidentally.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

3. Create a separate database

Create a database for site1.example.com and grant its Drupal database account the permissions required by the database driver. Separate databases provide the clearest isolation: backups, restores, credentials and destructive maintenance can be handled per site.

4. Create the site settings file

Copy sites/default/default.settings.php to the new directory as sites/site1.example.com/settings.php. Set that file’s database connection and any site-specific settings. Each site’s $databases array must define a default connection.

$databases['default']['default'] = [
  'database' => 'site1_database',
  'username' => 'site1_database_user',
  'password' => 'replace-with-the-site-password',
  'host' => 'database-host',
  'port' => '3306',
  'driver' => 'mysql',
];

The exact driver options depend on your database engine. Do not copy credentials from another site: the settings file is the boundary that tells Drupal which database belongs to this hostname.

5. Create the sites alias file

Copy sites/example.sites.php to sites/sites.php. Add a host-to-directory alias:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
$sites['site1.example.com'] = 'site1.example.com';

The value on the right is the configuration directory under sites/. Add another entry for every development or alternate hostname that should use the same site directory. For example, a development host can be mapped explicitly:

$sites['8080.dev.example.com'] = 'site1.example.com';

Drupal’s API describes alias keys as <port>.<domain>.<path> patterns. Use the form that matches the incoming host, port and path in your environment.

6. Point the virtual host at the shared root

Create an Apache virtual host, Nginx server block or equivalent for the new hostname. Set its document root to the shared Drupal installation. Do not point it at the site directory. Add any required server aliases, TLS configuration and normal Drupal rewrite handling in the same way as the first site.

A useful verification at this stage is to request the new hostname and confirm that the request reaches the shared codebase. A wrong document root can expose files or produce a server-level 404 before Drupal has a chance to select a site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

7. Configure trusted hosts

In every relevant settings.php, configure $settings['trusted_host_patterns'] to allow the legitimate domains and reject unexpected Host headers. A site with one exact hostname could use:

$settings['trusted_host_patterns'] = [
  '^site1.example.com$',
];

Add a separate pattern for each real hostname that should reach that site, including an approved development name when appropriate. Keep the patterns narrow; accepting an arbitrary Host header defeats the protection. Also configure the web server’s default response for requests sent to an unintended host, so an unknown hostname does not accidentally display one of the multisite installations.

8. Run the Drupal installer for the new hostname

Visit site1.example.com in a browser. Drupal should discover the new directory and start installation using its settings file and database. Enter the site name, administrative account and remaining installation values for this site.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

If the wrong site appears, use the official installer path /core/install.php on the intended hostname after checking the alias, directory name and virtual-host document root. Do not continue an installation until the correct database and site directory are selected.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

9. Repeat the pattern for each additional site

For every new site, repeat the directory, database, settings, alias, virtual-host, trusted-host and installer steps. Keep a written inventory of hostname, configuration directory, database, file paths, scheduled jobs and responsible administrators.

How Drupal selects the site configuration

Drupal first consults sites/sites.php for an alias matching the incoming port, domain and path. This is the most predictable method when a development hostname differs from production or when several hostnames intentionally share one site directory.

If no alias matches, Drupal derives candidate configuration-directory names from the incoming hostname and path. It uses the first candidate that contains a settings.php. If no suitable directory is found, Drupal falls back to sites/default.

This fallback explains two common mistakes. A misspelled alias can silently load the default site, and a missing settings.php can make a hostname appear unconfigured. Test every hostname explicitly rather than assuming that the directory name alone controls routing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Keep databases, files and configuration separated

Databases

Use one database per site when the sites are independent. This makes credentials, exports, restores and incident response easier to reason about. Drupal also supports table prefixes when several sites share one database, but that increases operational coupling: a database outage, permission error or maintenance operation can affect all prefixed sites. If you use prefixes, document the mapping and verify backup and restore procedures for each prefix.

Public and private files

Keep each site’s public and private files in that site’s own directory. Configure the paths in that site’s settings so an upload from site1.example.com cannot appear in site2.example.com simply because both sites use a shared filesystem root. Back up these file trees alongside their corresponding databases.

Configuration exports

Drupal configuration belongs to the site that generated it. Store and deploy exports with an unmistakable site identifier, and never apply one site’s configuration export to another site without checking dependencies. Shared code does not mean shared configuration.

Users and authentication

Separate databases mean separate user tables and login sessions by default. A user account created on one multisite installation is not automatically available on another. If common identity or shared permissions are a requirement, treat that as an architecture decision and assess a single site with domain-routing capabilities instead of assuming multisite supplies it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What remains shared operationally

Core and module updates

Updating shared Drupal core or a common module changes the code used by every site. This reduces duplicated maintenance, but a regression or incompatible dependency can affect the entire portfolio at once. Test updates against every site, schedule a maintenance window that covers the group, and retain a rollback path for both code and databases.

Site-specific extensions

Common modules and themes can live in shared locations. If one site needs a local extension, Drupal allows site-specific modules or themes in that site’s directory. Keep local code under version control and document why it is not shared; otherwise a later deployment can overwrite or omit it.

Backups and restores

Back up each database and its public and private files as a recoverable unit, while also backing up the shared code and deployment metadata. Test restoring one site without replacing another site’s files or database. A code rollback may need to cover all sites because they use the same release, whereas a content restore should normally target only the affected site.

Cron, caches and queues

Each site has its own Drupal state, so scheduled tasks, cache clearing and queue processing must run for every site that needs them. Design the scheduler to identify the site explicitly rather than assuming that running a command once against the shared root processes every database. Record which jobs belong to which hostname and avoid overlapping runs during a portfolio-wide deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Permissions and deployment

Shared code permissions must allow every site to read the same release while limiting write access to the directories that require it. Deployment automation should update common code once, then apply site-specific settings, files and configuration in a controlled order. Treat a failed deployment as a multisite incident until each site has been checked.

Core multisite versus one site with domain routing

Decision axis Drupal core multisite One Drupal site with domain-routing modules
Database and content isolation Normally one database per site; content is isolated by default One database and one content model; separation is implemented through domain rules
Users and authentication Separate user accounts and sessions unless you build an external integration Users and authentication can be shared within the single site
Configuration Each site has its own configuration and settings.php One site configuration with domain-aware behavior
Upgrade independence Shared code means core and common-module upgrades affect all sites together One codebase and one site still require coordinated upgrades, but there is no per-database multisite inventory
Filesystem and backups Separate site file trees and database backups are natural boundaries Files and backups are organized inside one site’s storage model
Domain and URL requirements Each hostname or path must resolve to the shared root and select a configuration directory Domains route inside one Drupal site after the application receives the request
Failure and deployment impact A shared code or dependency failure can take every site offline A single-site failure also affects all domains, while data and configuration are centrally coupled

The deciding question is whether the sites are independent products that merely share infrastructure, or one product presented through several domains. Use multisite for the former and domain routing for the latter.

Troubleshooting common multisite failures

The new hostname shows the default site

  • Confirm the request reaches the shared Drupal document root, not a different web root.
  • Check the exact spelling and punctuation of the key in sites/sites.php.
  • Verify that the target directory exists and contains settings.php.
  • Check whether an unintended alias or hostname candidate is being selected first.
  • Inspect the virtual host’s ServerName, aliases and DNS record.

Drupal reports an untrusted host

  • Add the legitimate hostname to that site’s trusted_host_patterns.
  • Escape literal dots in regular-expression patterns and use an exact pattern where possible.
  • Make sure the pattern is present in the settings file actually loaded for that hostname.
  • Do not solve the error by allowing every host; correct the DNS and virtual-host mapping instead.

The installer cannot connect to the database

  • Verify the database name, account, password, host, port and driver in the new site’s settings.php.
  • Confirm that the account has permissions on the intended database and not only on another site’s database.
  • Check that the database server is reachable from the web server and that the selected driver is available in PHP.

Uploads appear under the wrong site

  • Inspect public and private file path settings for both sites.
  • Ensure each site has its own files directory and that deployment scripts do not merge those directories.
  • Check filesystem ownership and permissions after moving or restoring a site.

An update breaks several sites

  • Stop further deployments and identify the shared code or dependency change.
  • Restore the shared code to the last known-good release if your rollback process supports it.
  • Restore databases only when the update changed schema or data and the rollback plan requires it; do not overwrite unaffected sites automatically.
  • Test every hostname, installer state, login and critical content path before reopening traffic.

A development hostname selects the wrong configuration

  • Add an explicit port-domain-path alias in sites/sites.php.
  • Confirm the browser is sending the hostname and port you used in the alias key.
  • Keep development aliases separate from production names and include only approved development hosts in trusted-host patterns.

Pre-launch checklist for each additional site

  • The hostname resolves in DNS and its virtual host points to the shared Drupal root.
  • The site directory exists under sites/ and contains the intended settings.php.
  • The database and account are unique to the site, unless a documented table-prefix design is intentional.
  • The sites/sites.php alias matches the incoming host, port and path.
  • Trusted-host patterns allow every legitimate hostname and no unintended hosts.
  • Public and private file paths are inside the site’s own storage boundary.
  • The installer completes on the intended hostname, and /core/install.php does not select another site.
  • Backups, cron, cache clearing, deployment and rollback procedures identify this site explicitly.
  • A shared-code update has been tested against every site that uses the release.

Bottom line for operating a Drupal multisite portfolio

Drupal multisite is a filesystem, database and web-server arrangement as much as it is a Drupal setting. Keep one codebase, give every site its own directory, database and files, map hosts deliberately, and route every virtual host to the shared root. The arrangement is efficient when sites can share release management, but that efficiency creates a common failure boundary: code, dependency and deployment mistakes can reach every site. Build backups, testing, trusted-host rules and rollback procedures around that fact from the first site onward.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.