How to install drupal locally using MAMP (Mac OS)

This guide shows how to install Drupal locally in Mac OS.

Steps

  1. Make sure composer 2.0 is installed
  1. Using terminal, navigate to the directory where you want to install the website
  2. Run composer create-project drupal/recommended-project:8.9.0 my-drupal8-project
  3. Install MAMP, if you have not already (https://documentation.mamp.info/en/MAMP-Mac/Installation/)
  • Open MAMP > Preferences > Server and setup the folder that you installed drupal in step 3 to be the document root
  • In Preferences > PHP make sure to run PHP version >= 7.3.
  • Start MAMP server and it will automatically open in your browser the MAMP main page
  1. From MAMP main page, open phpmyadmin and create a database
  2. From MAMP main page, open My website and navigate to /my-drupal8-project/web/ (this url depends on the document root you selected on Step 5)
  3. Follow the installation steps. On step 2 select Standard profile. On step 3 (database step), add the database/user you created on step 6.
  4. Done
2 Likes

Hi @kosamara,

In addition, I think it would be great to add a guide on how to get a Drupal instance up and running using Docker. It simplifies the process a lot :slight_smile:

The Dockerhub page has some info about also spinning up MySQL or PostgreSQL containers to provide a database and how to easily link them to the Drupal container. Also about volumes and persistance of the filesystem of the Drupal site.

It might be more advanced for some, but in general it’s a more modern way to do things and once the concepts are understood it is actually easier :wink:

Happy hacking!

PS: I am not working with Drupal a lot lately but if I ever try this method I might update this post or create a new one about the process

Óscar

3 Likes

Additionally, for users of Linux and Windows you can check these projects:

Hope it helps!

2 Likes