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.
1. Install Homebrew
(if you don’t already have it on your system)
- Dependencies: Xcode (from the App Store, in case you don’t already have it installed)
- In Terminal type:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. Install Composer
- Update Homebrew: in Terminal:
- Install PHP: in Terminal:
brew install php
- Install Composer: inTerminal:
brew install composer.
To test installation, run:
3. Local development with DDEV
curl -L https://raw.githubusercontent.com/drud/ddev/master/scripts/install_ddev.sh | bash
- Use this command to install Drupal, via Composer:
# 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.
- Run the following command (assumes DDEV):
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.
- Next, start the DDEV container:
You now have a web server and a database configured and running. To verify in your browser, go here. You should see this:
4. Install Drupal
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:
5. Next steps
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.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
|cookielawinfo-checbox-analytics||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".|
|cookielawinfo-checbox-functional||11 months||The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".|
|cookielawinfo-checbox-others||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.|
|cookielawinfo-checkbox-necessary||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".|
|cookielawinfo-checkbox-performance||11 months||This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".|
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.