How to setup WordPress locally on your Mac

November 16th, 2006 / 73 comments / blogging

If you work with WordPress on a regular basis you really need to setup Apache, MySQL, PHP, and WordPress on your machine - it makes developing themes, plug ins, and new blogs much simpler and (almost) all of your mistakes can be fixed before you go live.

wpmac.gif

Before you can install WordPress you need to install Apache, MySQL, and PHP. If you’re used to working with Linux you know the acronym LAMP - well, for a Mac we’re going to install MAMP. It’s a one click install that makes everything “just work” with a minimal amount of configuration. Unless you are very picky about your development environment MAMP should do the job.

Simple, right? We’re already halfway done.

The next thing we need to do is install WordPress. If you’ve done this on your server before then you know what’s up. The only “administration” we have to do is create a database using PHPMyAdmin. It’s easy, I swear:

mamp1.gif1. Load up the MAMP application, start Apache and MySQL.

2. Point your browser to: http://localhost:8888/MAMP/ and you’ll find yourself at the MAMP homepage. It’s a simple control panel that lets you edit anything important fairly easily. Click the PHPMyAdmin link.

3. Create a database. I called my “wordpress” because I am only installing it once. If you’d like to use more than one WordPress install I’d suggest naming the databases by site, although it doesn’t really matter.

4. Unpack your WordPress download to to ../mamp/htdocs/wordpress/. The /htdocs/ folder is your “live” folder - if you want to create a new site, simple create a new folder. For example, when I was working on the new Bleikamp.com I created ../mamp/bleikamp/2. Inside …/2/ I had index.html, styles.css, etc. It works just like any web server.

wpconfig.gif5. Load wp-config-sample.php into your favorite text editor. You’re going to need to edit the values so that WordPress can access MySQL on your machine. The default username for MySQL is “root.” The default password is also “root.” If you are planning on using MAMP on a live server, change those values. The host is “localhost:8888.” The database name is whatever you called your database in Step 3. Save it as wp-config.php in your ../mamp/htdocs/wordpress/ folder.

6. Run the idiot-proof WordPress 5 minute install (it should take about 30 seconds). Point your browser to: http://localhost:8888/wordpress/wp-admin/install.php.

After that, WordPress will be up and running and ready for you to play with. I use my single install of WordPress and simply change the theme over when I’m working on a new project. I rarely work on more than one project at once, so it’s not a problem. It would be very simple to add a second install at /wordpress2/ to work on two projects at once if I needed to.

Digg this

What Next?

73 responses so far ↓

Leave a Comment