> For the complete documentation index, see [llms.txt](https://ispectra.gitbook.io/mutamad/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ispectra.gitbook.io/mutamad/getting-started/installation.md). Agents can also search and read this documentation through its [MCP server](https://ispectra.gitbook.io/mutamad/~gitbook/mcp).

# Installation

Installing Mutamad with DDEV, with local PHP, from the browser, or recipe by recipe.

## 1. Create the project

Every Mutamad site starts from the **project template**, `drupal/mutamad_project`. It pins Drupal core and the Mutamad profile, scaffolds hardened settings, applies the patches Mutamad needs until they are released upstream, and ships a DDEV environment.

```bash
composer create-project "drupal/mutamad_project:^1.0@alpha" my-site
cd my-site
```

{% hint style="info" %}
**Why the template, and not `composer require drupal/mutamad`?** Only the root `composer.json` can allow alpha releases of dependencies (TFA, Canvas Translate, Entityqueue Form Order), declare the package repositories of the libraries the site serves itself (Tagify, Dropzone), and apply patches. The template does all three.
{% endhint %}

## 2. Install the site

Pick the way that matches your machine.

{% tabs %}
{% tab title="DDEV (recommended)" %}

```bash
ddev start
ddev install-mutamad            # Arabic, with English
ddev install-mutamad --lang=en  # English, with Arabic
```

`install-mutamad` runs the installer (`drush site:install mutamad`), then [`mutamad-verify`](https://ispectra.gitbook.io/mutamad/getting-started/verify.md), and exits with its status. Add `--quiet` to hide the installer's progress.
{% endtab %}

{% tab title="Local PHP and Composer" %}
With PHP 8.4, Composer and a database of your own:

```bash
composer install   # if vendor/ does not exist yet
vendor/bin/drush site:install mutamad \
  --db-url=mysql://user:password@localhost/mutamad \
  --locale=ar \
  --site-name="My entity" \
  --account-name=webmaster \
  --yes
```

Use `--locale=en` for an English site. Then check the controls, pointing the script at the site's address:

```bash
MUTAMAD_URL=https://my-site.local bash .ddev/commands/web/mutamad-verify
```

{% endtab %}

{% tab title="Browser installer" %}
After `ddev start` (or with your own web server), open the site's address. Mutamad's installer:

1. **Language** — Arabic or English. The language you choose is the site's default language; the other one is added.
2. **Site name** — your entity's name.
3. **Administrator account** — the break-glass account. Use a named mailbox, not a personal address.
4. **Progress** — the recipes are applied and translations downloaded.

The installer is in Arabic from its first step when Arabic is chosen.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Choose the default language at installation, not later.** Drupal fixes a field's language when the field is created, so the default language must be set before the first field exists. Changing it afterwards leaves every field created earlier with the old language default.
{% endhint %}

## What the installer does

The profile is thin: it owns the installer and nothing else. It:

1. Makes `settings.php` load Mutamad's hardened settings (`settings.mutamad.php`).
2. Creates the private files directory outside the web root.
3. Generates the 256-bit key that encrypts MFA secrets, into `private-files/mutamad-keys/`, outside the web root and the database.
4. Applies **Mutamad Standard Site** (`mutamad_starter`), the site template, which applies every other recipe in order. See [Architecture](https://ispectra.gitbook.io/mutamad/concepts/architecture.md).
5. Downloads Arabic translations from localize.drupal.org.
6. Locks configuration to the default language and translates recipe configuration.
7. Creates the scheduled-task jobs, publishes the shipped sample content, and sets the `security.txt` expiry a year ahead.

## Apply Mutamad to an existing Drupal site

Every Mutamad recipe applies on its own to a bare Drupal 11.4 site. To apply the whole site template to a fresh Drupal site:

```bash
composer config minimum-stability alpha
composer config prefer-stable true
composer require drupal/mutamad_starter
drush recipe ../recipes/mutamad_starter
```

Before that, set a private file path outside the web root in `settings.php`, and create the MFA key file (see [Settings reference](https://ispectra.gitbook.io/mutamad/reference/settings.md#the-mfa-encryption-key)):

```php
$settings['file_private_path'] = '../private-files';
```

To take a single feature, apply its recipe alone. For example, only the security baseline:

```bash
composer require drupal/mutamad_security
drush recipe ../recipes/mutamad_security
```

Each project's page under [All projects](https://ispectra.gitbook.io/mutamad/reference/projects.md) gives its exact commands. Recipes that ship with a module are applied by their path from the web root, for example `drush recipe modules/contrib/mutamad_search/recipe`.

{% hint style="info" %}
A site not built from the project template lacks its patches and hardened settings. Read [Production](https://ispectra.gitbook.io/mutamad/getting-started/production.md) and copy what applies, especially the logging block in `services.mutamad.yml`.
{% endhint %}

## Next

[After installation](https://ispectra.gitbook.io/mutamad/getting-started/after-installation.md)
