This is a quick guide on how to install Drupal programmatically on a Mac. The targeted audience is people who want to become familiar with Drupal, or need to get up to speed as quickly as possible. The steps below should get you up and running in no time.
(if you don’t already have it on your system)
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install php
brew install composer.
To test installation, run:
curl -L https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash
# Replace my-site-name!export SITE_NAME=my-site-namecomposer create-project drupal/recommended-project $SITE_NAMEcd $SITE_NAME
If everything went well, you should see this at the end:
This created a new directory and populated it with Drupal and its dependencies.
ddev config --docroot web --project-name $SITE_NAME --project-type drupal9
This will configure your new Drupal application to work with DDEV and will store the generated configuration in a new .ddev subdirectory.
You now have a web server and a database configured and running. To verify in your browser, go here. You should see this:
At this point you must install Drupal which will populates your Drupal app’s new database. Run this, and replace the “my-pasword” with a password of your choice. This will be for the “user 1” or “admin” account.
ddev exec drush site-install --account-name=admin --account-pass=my-password
Before the install begins, it will prompt you:
Choose “y.” The install will commence. After the installation is finished, run
to see the status of your Drupal site, the Project Information, the URLs, the DB credentials and other installed services, as well as the status of the DDEV Router and ssh-auth. For example, this is how it shows on my machine:
Go ahead and log in, using the user and password provided above:
Now that you’re up and running, you can start configuring your site. Things like site configuration, page management, setting up content structure, managing user accounts, as well as other advanced topics are explained here. Lastly, if your organization needs help setting up any of these advanced Drupal topics, please don’t hesitate to reach out to us. We’d love to help you get started.