PHPackages                             joachim-n/automultisites - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. joachim-n/automultisites

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joachim-n/automultisites
========================

Provides helper code for running Drupal with automatic multisites based on folder structure.

1.0.3(1y ago)016PHP

Since Jan 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/joachim-n/automultisites)[ Packagist](https://packagist.org/packages/joachim-n/automultisites)[ RSS](/packages/joachim-n-automultisites/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Automultisites
==============

[](#automultisites)

This is a collection of helpers for quickly creating new subsites in a local Drupal project. It can often be useful to create a new site using a project's codebase, either to debug or prototype on a fresh install, or to quickly switch between different copies of the database.

The subsites use subfolders, so there is no need for creating new virtual hosts.

A symlink in the Drupal root back to itself allows Drupal to function as if it were in a subfolder, which allows the multisite system to consider it a different site.

Compatibility
-------------

[](#compatibility)

- The Drush command requires Drush ^10.5.
- This is not entirely compatible with the joachim-n/drupal-core-development-project Composer project template.

Terminology
-----------

[](#terminology)

Each subsite has a *site directory*, which is its subdirectory in `sites/`. These have a common prefix, which defaults to `local-`. The part after the prefix is referred to as the *site key*, so for example with this directory listing:

- default
- local-alpha
- local-beta

the site keys are 'alpha' and 'beta'.

Installation
------------

[](#installation)

Install with Composer: `composer require joachim-n/automultisites`.

Drush command
-------------

[](#drush-command)

To create a new subsite with Drush, do:

```
$ drush multisite:new SITE-KEY

```

Manual instructions
-------------------

[](#manual-instructions)

Without Drush, do the following:

1. Copy sites/example.sites.php to sites/sites.php if it does not already exist
2. In sites.php, add the following code:

```
$sites = []; // Necessary workaround for Drush.
\Automultisites\Sites::addLocalSites($sites, $app_root);

```

3. Create a symlink of the Drupal root back to itself:

```
$ cd web
$ ln -s . local-alpha

```

4. Create a new site folder:

```
$ cd web/sites
$ mkdir local-alpha

```

5. Copy settings.php to it:

```
$ cp web/sites/default/default.settings.php web/sites/local-alpha/settings.php

```

6. In the new settings.php file, add the following code:

```
Automultisites\Settings::configureSiteSettings(
  $app_root,
  $site_path,
  $databases,
  $settings,
  $config
);

```

7. To create a Drush site alias, create a file drush/sites/local.site.yml and add the following to it:

```
alpha:
  root: /path/to/project/web
  uri: localhost.local-alpha

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~342 days

Total

4

Last Release

559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21043d4af2cb62a3e316647f63749d05fcbab1c9bd5e67ffa2079b0117e8f65a?d=identicon)[joachim-n](/maintainers/joachim-n)

---

Top Contributors

[![joachim-n](https://avatars.githubusercontent.com/u/105262?v=4)](https://github.com/joachim-n "joachim-n (16 commits)")

### Embed Badge

![Health badge](/badges/joachim-n-automultisites/health.svg)

```
[![Health](https://phpackages.com/badges/joachim-n-automultisites/health.svg)](https://phpackages.com/packages/joachim-n-automultisites)
```

###  Alternatives

[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
