Local development for Drupal 12: DDEV, Docker or PHP's own server

BuildingHosting

Drupal 12 needs PHP 8.5, which most computers do not have installed. The easiest way round that is to run Drupal in containers. Here are three ways to get a local Drupal 12 site, from the most complete to the quickest.

1. DDEV

DDEV is the most common local environment for Drupal, and it has a project type for Drupal 12:

  • DDEV 1.25.0 (February 2026) added the drupal12 project type. It sets PHP 8.5.
  • DDEV 1.25.6 (November 2026) ships PHP 8.5.13 – the version Drupal 12's release notes recommend – and pins Drush 14 for the Drupal 12 quickstart.
  • The plain drupal project type still means Drupal 11. Use drupal12 explicitly.

Update DDEV first, then:

mkdir my-drupal12-site && cd my-drupal12-site
ddev config --project-type=drupal12 --docroot=web
ddev start
ddev composer create-project drupal/recommended-project:^12@rc
ddev composer require "drush/drush:^14@dev"
ddev drush site:install --account-name=admin -y
ddev launch

DDEV's own quickstart for Drupal 12 uses drupal/recommended-project:main-dev@dev, the development branch of the next version. For a site you want to keep, use the release candidate (^12@rc) as above, and ^12 once 12.0.0 is released. (We build this site with Docker Compose, so we have not run this exact DDEV sequence ourselves; the version facts come from DDEV's releases, documentation and source code.) Requiring Drush 14 as a development version also lowers the project's minimum stability, as described in How to install Drupal 12 with Composer.

Without a password, site:install generates one and prints it; or log in with ddev drush uli.

2. Your own Docker Compose setup

This site runs in two containers, both locally and on the server: the official php:8.5-apache image with the PHP extensions Drupal needs, and mariadb:11.4. The advantage is that development and production are the same; the cost is that you maintain the setup yourself. The parts that matter:

  • PHP extensions: gd, pdo_mysql, intl and zip, installed in the Dockerfile. The official PHP image already has Argon2 support (and opcache, which is built into PHP 8.5), which Drupal 12 needs for its default password hash.
  • Settings from the environment: database name, user, password and hash salt are read with getenv() in settings.php, and the values live in an .env file that is not committed.
  • Composer in the container: run composer inside the PHP container, so that the platform check sees PHP 8.5 even if your computer has an older PHP.
  • A pitfall: if you mount a single file such as settings.php into the container, Docker keeps pointing at the old file after git replaces it (for example when you switch branches). Mount the folder, or recreate the container with docker compose up -d --force-recreate.

3. The quickest: quick-start with SQLite

If you have PHP 8.5 with pdo_sqlite on your computer and just want to look around:

composer create-project drupal/recommended-project:^12@rc try-d12
cd try-d12
vendor/bin/dr quick-start standard

This installs Drupal into an SQLite file, starts PHP's built-in web server and opens a login link in your browser. It is for trying things out only. See The dr command.

Which one?

  • DDEV if you work on several Drupal sites, in a team, or want Xdebug, mail catching and the rest without setting it up yourself.
  • Docker Compose if you want local and production to run exactly the same containers.
  • quick-start for a quick look at a new release, a recipe or a contributed module.