Do you want to host a WordPress site on your Mac? I host a local WordPress test site to create my plugins and themes. Here is a quick step by step guide to setup WordPress with MAMP for Mac in 7 easy steps.
- Download and Install MAMP for Mac
- Set Your Website or Websites Root Directory
- Download WordPress and Move It to the Website Root Directory
- Start the Web Server
- Create Your PHP Database
- Open WordPress and Start the Famous 5 Minute Install
- Complete the WordPress Install and Login
1. Download and Install MAMP for Mac
You can download MAMP for free here https://www.mamp.info/en/downloads/. After you have downloaded the MAMP_MAMP_PRO_X.X.pkg. Run the package installer.
After you have downloaded the MAMP_MAMP_PRO_X.X.pkg. Run the package installer.
Choose The Right MAMP for Mac
After the installer is complete you will have both a MAMP folder and MAMP Pro in your Applications folder. For this Tutorial, you will only need the MAMP folder. You can move MAMP Pro to the trash if you don’t want an extra application in your folder. Now open the MAMP for Mac application in the MAMP folder.
2. Set Your Website or Websites Root Directory
The root directory for MAMP is initially set to /Applications/MAMP/htdocs. This is where your website will be hosted. I recommend changing this folder to host you websites in either you documents folder or I create a folder called Sites in my home directory. The folder Sites happens to be the legacy folder that the built in OS X server will point to if you want to host websites using that instead of MAMP.
Changing the Website Root
To change the root directory open MAMP preferences. Next click on the “Web Server” tab. Beside the Document Root will be a select button. Use the select button to change the folder your websites will be located in.
Note: There are some more preference you will need to change if you want to setup you website to be access from another computer or from the web. Nothing else needs to be changed if your are setting this up to build test sites that you will only access from this computer.
3. Download WordPress and Move It to the Website Root Directory
You can download the latest version of WordPress here: https://wordpress.org/download/. After downloading and unzipping, move it to the Website Root Directory. You can also rename the WordPress folder. This is good if you want to have multiple WordPress sites you are working on. I named this site TestSite.
4. Start the Web Server
Simply on MAMP click the “Start Server” Button. You should see the Icon turn green and the button change to “Stop Server”. Now Click on “Open Webstart Page”. This will ope
5. Create Your PHP Database
Next Click the “TOOLS” tab then “PHPMYADMIN”. This will take you to http://localhost:8888/phpMyAdmin/?lang=en.
Click on the “Databases” tab and create a new database. To do this enter a name in the database name field and click create a database. I will use TestSite_DB. The name you use here is important, you will use it later. You don’t need to worry about the selection menu next to your name. This field will be set at utf8_general_ci for the collation and that will be fine.
6. Open WordPress and Start the Famous 5 Minute Install
Click on the “MY WEBSITE” Tab of the MAMP Start Page. You should be at an Index of folders. I like this so that I can build multiple websites, each one in its own folder.
If you only want to host one website you can go back to step 4 and change Website Root Directory to the directory of the single website.
On the Index page click the WordPress folder you made. For me this is TestSite. This will begin the WordPress Famous 5 Minute Install, which will take less than a minute since you already did most of the install.
Set the Database Name to the Name you choose in step 7. In my case this is TestSite_DB. The username and password should both be root. The Database Host should be localhost and you can leave the Table Prefix as wp_.
7. Complete the WordPress Install and Login
You should get confirmation that WordPress can communicate with your Database. Run the Installer and it should bring you to a Welcome screen. Here you will be setting your WordPress site name and you WordPress username and password. Press “Install WordPress”.