copy/paste instant Drupal 10 environment on MacOS with DDEV

Prerequisite - you'll need Docker installed.

Install DDEV if needed:

brew install drud/ddev/ddev
brew upgrade ddev
mkcert -install

Create your site:

mkdir my-drupal10-site
cd my-drupal10-site
ddev config --project-type=drupal10 --docroot=web --create-docroot
ddev start
ddev composer create drupal/recommended-project
ddev composer require drush/drush
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev drush uli
ddev launch

A quick rundown of the above:

  1. mkdir my-drupal10-site and cd my-drupal10-site create a folder on your machine for the project to live in and drops you into it
  2. ddev config --project-type=drupal10 --docroot=web --create-docroot creates ddev config for a Drupal 10 installation with the docroot living in /web
  3. ddev start fetches/starts all the Docker containers
  4. ddev composer create drupal/recommended-project gets Drupal core files
  5. ddev composer require drush/drush gets Drush
  6. ddev drush site:install --account-name=admin --account-pass=admin -y installs Drupal with a user/password of admin/admin
  7. ddev drush uli outputs a one-time admin login URL if you want to get in that way
  8. ddev launch launches the site in your default browser

Subsequent runs:

ddev start