In this setup, we are creating a Drupal core development environment using DDEV, a Docker-based local development tool. We start by configuring DDEV in a project directory, then clone the official Drupal core repository to work directly with its source code. After starting DDEV, we use Composer to install dependencies and Drush for command-line site management. We then install Drupal within the environment, launch the site in a browser, and access the container via SSH for further development. This setup allows developers to modify, test, and contribute to Drupal core efficiently in a controlled local environment.
Source code viewer
# Navigate to the Drupal core development directory. mkdir drupal-dev cd drupal-dev/ # Initialize DDEV in this directory (sets up configuration interactively). ddev config # Clone the official Drupal core repository (not just a site build, but the full core). # NB: Make sure you are on the correct branch. git clone https://git.drupalcode.org/project/drupal.git # Start DDEV, which launches the necessary services (web server, database, etc.). ddev start # Install dependencies defined in composer.json (Drupal core and libraries). ddev composer install # Require Drush, the Drupal command-line tool (if not already included). ddev composer require drush/drush # Install Drupal with a default configuration (creates database tables, admin user, etc.). ddev drush site:install -y # Open the site in the default web browser. ddev launch # SSH into the DDEV container to run commands inside the development environment. ddev sshProgramming Language: Bash