From ddev quickstart https://ddev.readthedocs.io/en/stable/users/quickstart/#drupal
mkdir civicrm && cd civicrm
ddev config --project-type=drupal --php-version=8.3 --docroot=web --database=mysql:8.0
ddev start
ddev composer create drupal/recommended-project:"^11"
ddev composer require drush/drush
ddev config --update
ddev restart
ddev drush site:install --account-name=admin --account-pass=admin -y
ddev launch
# or automatically log in with
ddev launch $(ddev drush uli)
Note quote marks around ^11 in line 7 - required for zsh.
Now CiviCRM https://docs.civicrm.org/installation/en/latest/drupal/:
ddev ssh # very important!!
composer config extra.enable-patching true
composer require civicrm/civicrm-{core,packages,drupal-8} -W
composer require civicrm/cli-tools