Skip to content

About

Automated local development environment for Drupal 11 projects. Features interactive assistant-driven .env creation, automated HTTPS trust via mkcert, and a unified management script for container orchestration and local domain mapping.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Drupal local development environment

A local Drupal 11 stack with Docker, Nginx, PHP-FPM and PostgreSQL. Use it for module and theme development.

Requirements

Setup

  1. Create your .env, build the Docker images and download Drupal:
./site setup
  1. Start the containers, update /etc/hosts and generate the HTTPS certificates:
./site start

The script asks for your sudo password to edit /etc/hosts.

  1. Open https://drupal.local and run the Drupal installer. Database settings:
Setting Value
Name drupal_db, or your .env value
User drupal_user
Password verystrongpassword, or your .env value
Host postgres

Management script

Command What it does
./site setup Creates .env interactively, builds the images, initializes Drupal.
./site start Checks ports 80/443, updates /etc/hosts, generates SSL certificates, starts the containers.
./site stop Stops and removes the project containers.
./site restart Stops, then starts the environment again.
./site reset Warning: removes everything and resets to the clean boilerplate.

Common tasks

Enter the PHP container and run commands directly:

docker compose exec php bash

Run Drush, installed as a Composer dependency, through the helper script. To clear all caches:

./drush cr

Install a module with Composer:

docker compose exec php composer require drupal/[module_name]

Open the PostgreSQL shell:

docker compose exec postgres psql -U drupal_user -d drupal_db

Project structure

  • web/, the Drupal root with index.php, themes and modules
  • vendor/, Composer dependencies and Drush
  • nginx.conf.template, the Nginx server configuration template
  • Dockerfile, the PHP image
  • docker-compose.yml, service orchestration

About

Automated local development environment for Drupal 11 projects. Features interactive assistant-driven .env creation, automated HTTPS trust via mkcert, and a unified management script for container orchestration and local domain mapping.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages