We noticed around the web that there were very few quick, straight-shooting tutorials on how to set up multiple WordPress sites on MAMP Pro. We also noticed that many people were having trouble doing this very thing; and for a developer, running multiple sites is really the purpose of purchasing MAMP Pro. Hopefully this quick guide will help. Please comment at the bottom if you have any troubleshooting issues.
Tools You’ll Need
Step 1 – Install WordPress
If you already have a WordPress install where you are working on a site. And this is the site you’d like to host locally with MAMP, then skip this step.
If not, hop over to WordPress and download a clean copy. Then, rename the root folder of that copy to the title of the site you plan on making. It’s always good practice to avoid spaces when naming anything that will be involved in your web development.
Step 2 – MAMP Pro Settings
The most important aspect of your MAMP Pro Settings are going to be in the Server < General tab of MAMP Pro. You’ll want to make sure the following things are in order:
- Apache: 8888
- SSL: 8890
- MySQL: 8889
- “Run Apache/MySQL server as user”: Yes !
MAMP Pro will have a “For security reasons…” warning against setting the apache to user; however, the whole point is to run this DB locally. When you migrate to your live host, this warning will no longer apply (if you set up your database properly).
Step 3 – Create the Local Site in Mamp Pro
Under the Hosts tab, create a new local site using the + sign. Designate a unique server name (again, using no spaces; example: “greenmarklocal”), and target the root WordPress folder for the site in the Disk Location section.
After you’ve added the new site, hit Apply in the bottom right-hand corner, and go ahead and Start your MAMP Pro server.
Step 4 – Create Your Local DB
We strongly recommend using Sequel Pro for setting up local DB’s. Of course, you can run the default PHPMyAdmin if you’d like, or jump over to any other method you prefer. But, Sequel Pro makes things as simple as they could possibly be, and it’s free! The following steps will quickly and properly set up your DB in Sequel Pro:
- Open Sequel Pro
- Sign in under the Socket tab, with user and password as “root” and “root”
- Under “Choose Database…”, select “Add Database…”
- Name the database with the identical title in the MAMP Pro setup (step 3)
- Hit “add”
- Minimize Sequel Pro, you’re done!
Step 5 – Edit the wp-config-sample.php File in WordPress
If you just made a clean install of WordPress, go to the root folder and find the wp-config-sample.php file. (If you are dealing with an already established and edited WP site, the file will be called wp-config.php). Open this file in a text editor, and make these changes:
- Change the ‘DB_NAME’ to the title you used in MAMP Pro and Sequel Pro
- Change the ‘DB_USER’ to “root”
- Change the ‘DB_PASSWORD’ to “root”
- Make sure your ‘DB_Host’ is set to “localhost”
- **Save the file, and if necessary, rename the file to just “wp-config.php”
Step 6 – Load the Local URL & Setup your WordPress Site
Probably the most commonly made mistake when using MAMP Pro is not understanding how to target the site that you’ve now successfully setup. If you aligned your port (and other) MAMP Pro settings with those that we’ve shown in this tutorial (see screencast for all settings used), then your local URL for the site will be “yoursite:8888″. This will direct you to setup your WordPress install, and there you can begin crafting your WordPress site locally, and host multiple of these at the same time.
If for some reason your browser pulls up a search engine result by default, then simply go to the MAMP Pro Hosts, and click on the Home button next to your Server Name. This will force your browser to open the local site you’ve created.
We hope this was useful for some of you. If you have any questions, please post in our comments section and we will get back to you with troubleshooting help asap! :)