Ever want to be able to play with WordPress and not worry about breaking your live site? Want to have an environment where you can try different things like plugins, themes, or that cool tutorial you found and want to work through? Well, then this is the post for you, (especially if you’re a Mac user). I’m going to walk you through installing WordPress on your Mac computer and working with it just as if it was a live production environment. (*Note: This is a “by request” post; I was asked to write about this by a few students in each of my Intro to WordPress classes. I’m going to do a couple of these, series-like–one for Mac users and one for Windows users.)
What you will need to get started:
- A computer running the Mac OSx
- A good amount of hard drive space (There isn’t a hard and fast number here, but I would suggest something around 50-75 GB, especially if you are going to be working on multiple sites).
- A copy of MAMP, downloaded from this site
What is MAMP?
MAMP is a piece of software that gives you all the tools you need to run WordPress on your own machine for development and testing purposes. MAMP stands for Macintosh, Apache, MySQL and PHP. When it is installed, MAMP allows you to run a webserver locally on your machine with access to a MySQL server and PHP. While there are other ways of achieving the same result, like manually installing Apache, MySQl and PHP, this is easily the quickest and most efficient way to do it.
Setting up MAMP on your Mac
As stated previously, I think MAMP is the best solution for running WordPress (and websites in general) on your Mac. And while there is a paid, pro version available, the free one does everything you need it to do…and did I mention it is free?
So, the first thing you want to do is download the software from www.mamp.info. Then, locate the file you downloaded (it will be named something like MAMP_MAMP_PRO_2.05.dmg, depending on what version you downloaded), and install it like you would any other application for your Mac.
Just like that, you have MAMP installed on your computer, and you’re halfway to running your own development environment!
Now you can start MAMP up, (which you can do from Applications/MAMP, unless you’ve installed it somewhere else), and you’ll see two things. First up will be the awesome desktop widget (pictured below) that lets you start and stop the servers as well as launch the start page. You can also go through the settings found inside the Preferences button on the widget, but there really is no need to do this since MAMP works pretty smoothly right out of the box. The second thing you’ll see is the MAMP start page, but I’m getting to that in a second.
The next thing you’ll need to do is set up a MySQL database for your local WordPress install. On the MAMP start page, there is a link to PHP MyAdmin. You can get the start page to launch from the dashboard widget by clicking on the button cleverly labelled “Open start page.” On the PHP My Admin page, you’ll find the tools you need to create a new database. The best part of this page is the ability to set up literally hundreds of databases if you need them. This is especially great if you are doing client work, because you can have a separate database for each client project, and, when the time comes to migrate the work from your local machine to their hosting provider, you can package everything up–database and all–and move it on over. Once you have the database all set up, it’s time to install WordPress!
If you have ever installed WordPress on a hosting provider’s site, you know that FTPing the files can take a few minutes. One of the nice things about working locally is how quickly you can have a new WordPress install up and running.
Here is how I go about installing WordPress:
- Create a new folder in the htdocs directory of your MAMP installation. This is where your site will live.
- I keep a copy of the latest version of WordPress unzipped and ready to go on my hard drive (I keep mine in the cleverly labeled folder called WP in my Documents folder). Simply copy and paste all of the files from the WordPress folder into the folder you created for your site.
- Open a browser of your liking and navigate to localhost:8888/yoursitename/wp-login.php and run through the (less than) 5 minute install.
- Once you’ve done that, presto!, you now have a fully functional WordPress install/site to work on at your leisure!
Hopefully, this takes the mystery out of installing WordPress locally on your Mac. I’ll do a walk through for Windows users in the next couple of days.