PHPackages                             dpi/drupal-local - 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. dpi/drupal-local

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

dpi/drupal-local
================

2.0.0(3y ago)71PHP

Since Nov 13Pushed 3y ago2 watchersCompare

[ Source](https://github.com/dpi/drupal-local)[ Packagist](https://packagist.org/packages/dpi/drupal-local)[ RSS](/packages/dpi-drupal-local/feed)WikiDiscussions 1.x Synced 1w ago

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

Local Drupal Development

This setup is exclusively for local development only.

Setup
=====

[](#setup)

This setup has been tested with :

- Apple Silicon M1
- macOS Monterey
- Local clone
- Git
- Docker for Mac
- Composer
- Brew

Usage
=====

[](#usage)

1. `composer create-project dpi/drupal-local`
2. `cp .env.dist .env` and add values.
3. `composer install`
4. Install Certificates, see *Local TLS* section below.
5. Optionally copy and remove `dist.` prefix from settings files.
6. `docker-compose up -d`

Drupal
------

[](#drupal)

Drupal is accessible at

### Installation

[](#installation)

```
docker-compose exec php-cli bash
drush si standard -y
```

### Common tasks

[](#common-tasks)

```
# Set Claro as admin theme:
drush theme:enable claro && drush config:set system.theme admin claro -y && drush cr
```

Alternative hostnames
---------------------

[](#alternative-hostnames)

Want to use a hostname other than localhost, such as DOMAIN.localhost? (automat- ically works with Firefox / Chrome) Or any others with editing host file?

1. Update URLs and hostnames in `.env` file.
2. Generate certificates for new hostname (See *Local TLS*).
3. `docker-compose up -d`

### Redis

[](#redis)

```
# Enable Redis before copying files because new services depend on Redis.module.
drush en redis
cp ./app/sites/default/dist.settings.redis.php ./app/sites/default/settings.redis.php
cp ./app/sites/default/dist.services.redis.yml ./app/sites/default/services.redis.php
drush cr
```

### Configuration Export/Import

[](#configuration-exportimport)

Config YAML will be exported to `./config/`, alternatively use MySQL dump and auto restoration per below.

```
drush config:export
drush config:import
```

Local TLS
---------

[](#local-tls)

[Why local HTTPS](https://web.dev/how-to-use-local-https/)? Just because! Also Secure Cookies! And other things probably.

```
brew install mkcert nss
# Replace 'localhost' with alternative hostname, if desired.
mkcert -cert-file=certificates/primary.pem -key-file=certificates/primary-key.pem localhost
mkcert -install
```

More certificates can be defined in `traefik/config/certificates.yaml`.

MySQL Dump
----------

[](#mysql-dump)

Dump the MySQL database from the PHPCLI container so the setup can be restarted.

```
drush sql-dump --result-file=../sql/init/dump.sql
```

The dump will be automatically imported if you `docker-compose down` then restart the application. The app will take a few extra seconds to be ready. Tail the database log with `docker-compose logs -f db` to track progress.

Mailhog
-------

[](#mailhog)

Mailhog will capture emails sent by Drupal. There is no need to configure Drupal as `sendmail_path` is [configured](https://github.com/skpr/containers/blob/master/php/base/conf.d/50_overrides.ini).

Mailhog is accessible at

Traefik
-------

[](#traefik)

Dashboard is accessible at

Development
===========

[](#development)

PHPStan
-------

[](#phpstan)

Optionally customise PHPStan configuration with `cp phpstan.neon.dist phpstan.neon`. The .dist file will be used by default.

```
phpstan analyse
```

PHPCS
-----

[](#phpcs)

Optionally customise PHPCS configuration with `cp phpcs.xml.dist phpcs.xml`. The .dist file will be used by default.

```
phpcs
```

PHPUnit
-------

[](#phpunit)

Optionally customise PHPUnit configuration with `cp phpunit.xml.dist phpunit.xml`. The .dist file will be used by default.

```
phpunit
```

Blackfire
---------

[](#blackfire)

Define client and server ID and tokens in .env.

### Web profiling

[](#web-profiling)

#### Browser extension

[](#browser-extension)

Enable the browser extension as normal.

Navigate to the page you wish to profile, and click 'Profile!' button.

Note: does not work properly if you're using Firefox container tabs. Use a container-less tab when profiling in Firefox.

#### Docker compose

[](#docker-compose)

`docker-compose exec blackfire blackfire curl http://nginx:8080/`

#### Blackfire CLI app

[](#blackfire-cli-app)

Blackfire client (`blackfire`) is built into the PHP CLI container (`Dockerfile-php-cli`):

```
docker-compose exec php-cli bash
blackfire curl http://nginx:8080/

```

### CLI app profiling

[](#cli-app-profiling)

```
docker-compose exec php-cli bash
blackfire run drush foo

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~162 days

Total

3

Last Release

1324d ago

Major Versions

1.0.0 → 2.0.02022-10-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a8e9cf072797a1662cbb1cb98e9a1d5e6eac6c5c4d798365a9f715bb6a67d0c?d=identicon)[dpi](/maintainers/dpi)

---

Top Contributors

[![dpi](https://avatars.githubusercontent.com/u/21850?v=4)](https://github.com/dpi "dpi (21 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dpi-drupal-local/health.svg)

```
[![Health](https://phpackages.com/badges/dpi-drupal-local/health.svg)](https://phpackages.com/packages/dpi-drupal-local)
```

###  Alternatives

[farmos/farmos

A web-based farm record keeping application.

1.2k6.7k1](/packages/farmos-farmos)[drupalwxt/wxt

Project template for Drupal 10 sites built with the WxT distribution.

29159.8k8](/packages/drupalwxt-wxt)[fourkitchens/sous-drupal-project

Starter project for Sous a Drupal distribution featuring a theme based on Emulsify Design System.

151.0k](/packages/fourkitchens-sous-drupal-project)[docomoinnovations/cloud_orchestrator

Cloud orchestrator distribution by DOCOMO Innovations, Inc.

108.4k](/packages/docomoinnovations-cloud-orchestrator)

PHPackages © 2026

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