Quick & Easy Drupal 10/11 Dev Environment with Docker and DDEV

Setting up a local Drupal 10/11 development environment has never been easier, thanks to Docker and DDEV. Follow this simple guide to get up and running in minutes.

Prerequisites

Before you begin, ensure you have the following installed:

Step 1: Create a New Drupal Project with DDEV

Open your terminal, navigate to your projects directory, and run:

mkdir my-drupal-site && cd my-drupal-site

Initialize the Drupal project for DDEV:

ddev config --project-type=drupal10 --docroot=web

This sets up the necessary configuration files for DDEV.

Step 2: Start the DDEV Environment

Now, start the DDEV environment with:

ddev start

This will:

  • Launch a Docker-based environment with PHP, MySQL, and Apache.
  • Provide a local domain (e.g., https://my-drupal-site.ddev.site).

Once completed, DDEV will display a message confirming that your environment is running.

Step 3: Install Drupal

You can install Drupal using one of the following methods:

Option 1: Quick Install with Drush

If you prefer an automated installation, run:

ddev composer create "drupal/recommended-project"
ddev composer require drush/drush

Then, install Drupal:

ddev drush site:install --account-name=admin --account-pass=admin

Option 2: Install via Web UI

For a manual installation using MySQL:

  1. Open https://my-drupal-site.ddev.site in your browser.
  2. Follow the Drupal installation steps and enter the following database credentials:
    • Database Name: db
    • Username: db
    • Password: db
    • Host: db (instead of localhost)

You’re All Set!

Congratulations! You now have a fully functional Drupal 10/11 development environment running on Docker with DDEV. 🚀 Happy coding!