I have been working on a Mac for a long time now, but before making the switch, I used to work on Windows. When you wanted to install and set up WordPress locally back in the day, your best options were WAMPserver or XAMPP. These programs enabled you to set up a local server and everything that goes with it to run any type of project, WordPress included.
The simplest and fastest way to set up a WordPress local environment on a Mac is via MAMP (what is it with these names, right?). MAMP is an acronym for macOS, Apache, and PHP, Perl, or Python.
Everything we need to serve WordPress locally is available to us via MAMP, so let’s dig right in and get this set up in a few minutes.
5 easy steps to set up WordPress local environment.
Table of Contents
1. Download and set up Mamp
Navigate to the MAMP website, download the MAC free version and then install it as you would with any other Application (program) on a macOS.
Once you have downloaded and installed MAMP, you have to turn on the server by pressing the ON button icon and it will open the default page/screen at http://localhost:8888/
You can change the ports by clicking the PREFERENCES icon in MAMP. If you are not sure what this means, just leave the default ports.
Now you need to create a folder where we will add our site. Right-click -> New folder or if you are using the Terminal mkdir folder-name and enter. Name it per your project.
Now we will go to the MAMP again, and select the folder we just created as our DOCUMENT ROOT by clicking “Choose” and navigating to our folder.
When we download WordPress, we will copy it to THIS folder.
2. Download WordPress
Navigate to WordPress.org and download the latest version of WordPress. Once downloaded, extract the files from .zip and copy them to the folder (which carries the name of your project) you set as your directory root in the previous step.
3. Create a database in phpMyAdmin
In order to run and use WordPress successfully we need a database. We will create a MySQL database and use phpMyAdmin to create and work with it.
We will access phpMyAdmin by entering the following URL in our browser: http://localhost:8888/phpMyAdmin
Now we will click the DATABASES link:
Enter the database name (your-project-database or something similar) and click Create. Remember the database name.
4. Run the WordPress installation
The only thing left to do is to install WordPress. Luckily, this is a simple few-clicks-type-of installation.
Go to your browser and enter http://localhost:8888/your-site-name (the name you named your folder).
You will now see the welcome screen for the WordPress installation.
You will need the database name – the name you gave your database in the previous step. The username and password when installing WordPress locally via MAMP will both be root.
You can leave the host and table prefix as they are. Click “Let’s go!”.
You will now select the language for your site/admin:
Fill in your database name and other fields. If everything was entered correctly, you will see the following screen:
Run the installation, and enter the requested information:
Grab a beer. You are done.
Photo by engin akyurt on Unsplash
And that’s it. You are done. Grab a beer and enjoy.
Leave a comment