How to setup WordPress locally on your Mac

Want to get a head start on WordPress development? Check out Thesis - it is a full featured theme, but also a framework to help build themes faster. I use it on Bleikamp.com.

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

{ 14 trackbacks }

How to setup Wordpress locally on your Mac at The Blog Herald
November 16, 2006 at 12:50 am
  How to Setup WordPress Locally on Your Mac by Blogging Pro
November 16, 2006 at 11:40 am
Speedlinking 17 November 2006
November 16, 2006 at 10:28 pm
TechSpot » Spawners Nov18
November 18, 2006 at 2:33 am
blogdriverswaltz.com » Blog Archive » links for 2006-11-18
November 18, 2006 at 4:18 pm
Création Thème WP Leçon #1: Installation de Wordpress en local
March 22, 2007 at 3:22 am
WP for the Mac « 0ddn1x: tricks with *nix
March 31, 2007 at 3:19 pm
ShiftClick Blog › Local web development tools
April 20, 2007 at 2:07 pm
cecily (dot) info » links for 04-27-07
April 27, 2007 at 9:55 am
Installing WordPress Locally - Mac and Windows : WordPress Themes
May 17, 2007 at 8:11 am
The WordPress Podcast » Blog Archive » Episode 11: David Peralty joins as co-host, transcripts are added, and KWEE
August 11, 2007 at 9:56 pm
Install Apache, PHP, MySQL on Your Mac at mistersnodgrass
October 29, 2007 at 7:31 am
Using Wordpress Locally On Your Computer
December 5, 2007 at 12:21 pm
WordPress locally on Mac with MAMP | Building the In-house Design Blog
December 21, 2007 at 2:12 pm

{ 44 comments… read them below or add one }

1 Chris P. November 16, 2006 at 12:46 am

I’ve known about this testing environment for months, but stupidly, I’ve never used it.

I’m definitely going to be all over this like white on rice. I mean, you almost have to come up with a good reason not to use the MAMP setup at this point.

2 Aaron Brazell November 16, 2006 at 1:28 am

Excellent, Ben. Are you sure you’re a designer and not a tech? ;-)

3 Ben November 16, 2006 at 2:02 am

Even a designer can figure this stuff out ;)

4 Mike November 16, 2006 at 10:47 pm

Thanks for this Ben. I was thinking of spending the whole afternoon trying to install WP on Mac. I’m finished in 3 minutes and I’m bored now :-)

Oh, I may as well play a little with WordPress.

Cheers, Mike.

5 Ben November 16, 2006 at 10:53 pm

Glad it was so easy Mike. Can anyone beat 3 minutes? ;)

6 Brajeshwar November 16, 2006 at 11:42 pm

Yes, MAMP indeed makes it so easy to run WebDev on the Mac.

7 Zach Forrester November 17, 2006 at 8:41 pm

Wow.
That actually, was very, very easy.
Thanks

8 Demetrius Ford November 26, 2006 at 4:00 pm

Hey Ben This is Demetrius again down in sunny Orlando, Florida. I like the new look of your site. I did install mamp with wordpress. I love it. I did need some help though but I got someone from apple pro care to configure my system. That’s why I bought apple pro care!

*Learning web design one http at a time***

9 Kai December 4, 2006 at 9:13 pm

OK, I got it all up and running on my own computer - thanks for the great directions! Would you be willing to give some pointers on the next step: how to move the files I’m testing on my machine up to a server? and vice versa? That would complete the lesson for me!

Thanks!

10 Kurt December 12, 2006 at 1:47 am

Very useful information for Mac users. Keep up the good work.

11 Ray December 22, 2006 at 12:30 pm

Hey, I’m glad I found your post on this. I just got a MacBook and am slowly looking into the alternatives to do things I used to do with my Windows PC. Spring semester is coming up and I was thinking a good way to blow time between some awkward scheduling would be if I could figure out how to run WordPress locally on my MacBook. Now I can spend all that time picking away at code or graphics and working on my blog for fun. At least, that’s the plan. Thanks for the easy information!

12 dee December 24, 2006 at 1:50 pm

I have been using a dev environment for my web development for some time, but never knew about MAMP and your walkthrough was great…keep up the good work.

13 allison December 27, 2006 at 11:58 pm

this is a set up ive scoured over and over for. simple awesome THANK YOU

14 webcomic January 31, 2007 at 8:08 am

I have not problems with a new installation/wordpress but I can’t connect correctly my pre-existing db/blog
“Error establishing a database connection”
have you a trick for me?

15 Jürgen March 17, 2007 at 1:21 pm

Hey Ben, thanks for the tipp how to setup it on apple. Good information. Thanks! Jürgen :-)

16 Christian March 19, 2007 at 11:45 am

Great post - now I can test everything before going online!

17 Christopher Doval April 11, 2007 at 10:42 am

Great post it’s been a big help, far more clear than the other tutorials I’ve found online. I’m having a little trouble reconnecting to wordpress after I close the tab that it’s running under. I’me not familiar with this whole process. thanks

18 Oyvind Solstad August 12, 2007 at 4:03 pm

Remind me to give you a round of beers (or other prefered liquids) if we ever meet. I knew about this but never thought about setting it up myself. Absolutely brilliant. Superfast and no wifi needed. And the textmate trick is priceless.

Thanks!

19 Oyvind Solstad August 15, 2007 at 12:53 am

One question though: If I use full URLs when linking between posts on my test site, I guess all these links will be broken when I move the site online.

Is there some way to put the URLs so that they are correct when online too?

Example: Right now one URL is:

localhost:8888/htdocs/testsite/wordpress/kvm/

KVM is the name of the article (I use a permalink structure where dates are omitted from posts).

How would I link to this post from another post? I tried to just put “/kvm” as a URL, but then wordpress tried to access

localhost:8888/htdocs/testsite/wordpress/name-of-article-linked-from/kvm/

which of course is wrong.

20 Brad August 15, 2007 at 5:43 am

Hi there, I just created a wordpress blog, and remembered seeing this somewhere before. Forgive my ignorance, I’m a long-time blogger who likes to be a bit creative, but this is beyond me!

Can you tell me why I would want to do this? Is it just about changing the look and feel of a wordpress blog offline? Or is it for writing posts offline?

Thanks!

21 Garus Booth September 11, 2007 at 6:01 pm

wow this was quick and painless!
Thanks for the tutorial.

22 simon Cooper September 19, 2007 at 2:53 pm

How can I test the pages before going live please?

23 The Merry Drinker November 8, 2007 at 4:35 pm

Many thanks for your tutorial. I am yet another Windows-to-Mac refugee who found that the Mac version of XAMPP doesn’t work so well. MAMP works perfectly, and your instructions on how to install it are a model of lucidity.

24 Paul December 28, 2007 at 1:02 am

Thanks for this… just what I needed…

25 Timothy Andrew February 5, 2008 at 2:23 am

Thanks, this is very helpful. I’m downloading MAMP now.

I suppose MAMP was created to run self-hosted servers, right?

26 Brez March 31, 2008 at 7:26 am

Thanks for the great tip. On my setup tho, I needed to change step five to read “localhost:8889” instead of “localhost:8888.”

27 BranDJ April 17, 2008 at 9:17 am

Wow.
Thanks for this easy walk-through!

28 Party Plan Pat May 31, 2008 at 1:58 am

Genius Mate! I have been scratching my head wondering if it is time for me to just call it a day and buy a PC! Thanks Damsel In Distress!

29 Mark September 14, 2008 at 8:56 am

Hello, Ben: After all of the posts from others on how easy this is, I feel like an idiot. But I am new to the world of wordpress & was interested in setting it up on my mac. I can’t get past steps 3 & 4. I “create” the database, but I don’t know where to go from there. After titling it “wordpress,” I can’t figure out what to do. There are questions about setting up tables & fields & I just don’t get it. Then in step 4, I don’t know what it means to “unpack wordpress download,” since when I signed up for wordpress, there was no download.

Thanks in advance if you have a moment.

30 Luuk January 21, 2009 at 9:16 am

Thanks! Your tutorial helped me al lot! :)

31 fridolin, dude January 21, 2009 at 11:40 pm

amazing, thank you + god bless the internet!

32 carey March 6, 2009 at 9:59 am

Just a note to say thanks for putting this up - I finally was able to install this on my mac thanks to you. One note that stumped me - don’t use Dreamweaver as your text editor. Most of you probably know that, but I didn’t and it stumped me for a couple hours!

33 Alexander Dombroff March 9, 2009 at 2:11 pm

After trying to do it on my own, I couldn’t find where to publish. The /MAMP/htdocs was the answer.

34 Leah April 5, 2009 at 7:13 am

Hey Ben,

I am trying to get all this offline stuff working because I am a volunteer with limited internet access. I am pretty weak in technology areas, and I am stuck at step 4. I made a folder called ‘wordpress’ in the htdocs folder of MAMP, but how do I download my page info into it? Or do I put something in that folder? And then the gargon in step 5 kinda lost me… so of course I tried just jumping to step 6 and it said the server was not found. I think I’m missing something… Can you help?

Thanks

35 Chuck April 9, 2009 at 7:22 pm

Step 4 is pretty vague - I have the same issue as Leah.

36 Robbie May 10, 2009 at 3:41 pm

Hi, I must be doing something wrong!

On step 2, when I type “http://localhost:8888/MAMP/” in my web browser I’m returned with a message saying “…can’t connect to server”. If however I type “http://localhost:8o/MAMP/”, then I CAN access the MAMP homepage.

From this point I followed steps 3, 4 and 5.

On step 6 when I type “http://localhost:8888/wordpress/wp-admin/install.php” I am again returned with the message “…can’t connect to server”. The same happens when I replace 8888 with 80. I can’t install WP. HELP! :(

37 MissGesTagua June 12, 2009 at 5:20 am

????? ????? ????? ????? ?? ????????. ? ??????????? ??????? ???? ?????? ??? ?? ?? ??????. ????? ????, ????? ?????? ????????? ? ??????????? ???????????, ??????????? ? ????? ???????????, ??????, ???????? ?????????????, ??????.

??? ??????? ?????????? ? ???? ????? ?????? ?? ?????? ??? ????????? ? ??????????? ? ??? ????????, ?????????????. ???????, ??? ??? ????????? ? ?????? ??????, ???????? ???? ???????. ?????? ??? ?????? ??? ?????? ??????????.

?????? ? ?? ??????? ???????? ???????? ????, ? ??? ???????? ????. ???? ??? ???????? ??????? ??? ???????? ????? ? ?? ???? ???? ?? ??????. “??? ?? ?????? ? ????? ???????” - ???????? ???. “?? ???? ?? ????? ?? ????? ????”, - ???????? ?. ??? ?????????? ? ?????????? ???? ? ????? ?? ????????? ????. ????? ? ?????? ? ???, ?????????, ??? ? ??? ??????? 4-5 ??? ????? ????????????? ?????. ????? ????????? ??????, ?????? ? ??????????, ??? ???????? ?? ? ??????????? ?? ??????????. ?? ??????? ????? ?????? “? ??????? ????? ?? ??????????, ???????????? ? ?.?.” ????? ???? ?????? ? ? ????? ???????????? ???? ????????? ? ???????? ??????. ??????? 5 ??? ??????? - ??? ???????. ? ?????? ????, ?? ?????. ?????? ? ???? ???? ??????? ? ??????? ???????? ????? - ????? ??????????? ???????? Isotoner. ? ???? ? ??????? ???? ?????? ?????????? ???????? ???????. ??? ????? ??????? ?? ?????? ??????? ??????? ???????? ?????. ??? ??? ???????????? ????? ????? ??? ??????????? ???????? ?????? ?????.

? ??????, ????? ?? ???????????? ? ???, ?? ?????? ??? ????????? ???? ?????? ??????, ?????????? ??? ???????????. ???????? ?? ?… ????? ? ?????????? ?? ?????? ??????? ??? ? ?????? ????-?? ?????.

? ????? ????? ? ????? ????? ? ? ????? ???? ???????? ??????

38 PeseeSlerhar June 13, 2009 at 10:07 am

Tired of a competitor’s site? Hinder the enemy? Fed pioneers or copywriters?

Kill their sites! How? We will help you in this!
Obstructions of any site, portal, shop!

Different types of attacks: Date-attack, Trash, Attack, Attack, etc. Intellectual
You can work on schedule, as well as the simultaneous attack of several sites.

On average the data, ordered the site falls within 5 minutes after the start. As a demonstration of our capabilities, allows screening.

Our prices

24 hours of attack - $ 70
12 hours of the attack - $ 50
1 hour attack - $ 25

Contact via ICQ: 588 666 582

39 GifeiPlanet June 15, 2009 at 11:31 pm

????????????.

? ???? ???? ????. ? ??????????? ???. :( ????? ?????? ??????? ??????????? ???????????. ??????????? ???? ????? ????????, ??? ?????? ?? ???????. ????? ????? ???????? ??????? ?????? ?????? ? ????????? ?? ??????:

“??? ????????????? ??????: ??? ????? ????? ???????? ? ??????? ?????? ??????? ???? ?????????????? ?????? ?? ?????? ? ????????? ? ?????????? ? ???????, ???????? ??, ? ??? ?????? ?????-?? ????. ??? ? ????? ??????????? ????? ?? ??? ?? ??????? ? ???????. ???????? ????? ?… ?? ????… ???????? ???-?? ?????????????. ??? ?? ?????, ????? ?? ???????????, ??? ???? ???????????? ???????? ? ?????? ??????????? ????????…” ????????

??????? ????????? ? ??????? ? ??????? ?? ???????. ?????? ??? ??????. ?? ??????????? ???????? ???????? ????????. ???????? ?????????? ?????: “????? ??????? ???????? ??????????? ? ???????? ? ???????. ??? ???????, ??? ???? ??????? ???????? ??????? ????????????, ????? ??????? ?? ????????? ???? ?????????, ??????? ??? ????????????????”.

?? ?????? ???????? ?????????:
- ?????????? ???????????
- ?????????? ????????? ?????
- ??????????? ?? ??????- ? ?????????????? ????????? ???????? ? ????????? ????????
- ?????????? ???
- ?????????? PR

??? ???. ??????????, ?? ?????????, ? ?????????????? ?? ? ???. ????? ?????????????? ? ????. ????? ?? ???????? ?????? ?? ???????? ???-?????? ??? ????? ????????? ????? ??? ??????????

40 Essaylandia June 18, 2009 at 9:40 am

I rarely do not comment on blogs but yours I had to stop and say Great article!!

41 QueenKeleter June 19, 2009 at 12:58 am

?????? ????.

??? ??? ????????? ??????. ???? ??????????? , ??? ?????? ???, ????? ?????? ?????? ??? ????????. ?? ? ?????? ??? ????????? ???. ???????????? ? ??????. ???????? ? ???????. ??? ???????????? ????????????? ??????. ????? ???????? ?? ????????, ????????, ????????. ?? ? ?? ??? ??????, ??????? ?????? ?? ??? ????????????? ??????? ? ??? ?????? ??? ???? ?????. ??? ?? ????????? ??? ?? ????????? ???? ????? ?????????? ??????? ? ????? ?? ??????????????

????? ????? ??????? - ???????????? ??????? ????????????. ?? ??? ? ??? ???????????? ?? ????? ??????????? ??????????: Caribbean Gold, California Tan ? ?.?. ??? ?? ?????????? ? ?? ????????????? ????? ??? ???? ?????? ????? ?????? ????? ???????? ?????? ??????…

? ?????? ? ??????? ???? ??? ????? ?????? ????? ??? ?????? ???? ??????? ?????. ?? ? ???? ? ??????. ?? ????? ?? ? ?????? ?? ??????. :) ????? ??????????, ??? ?????: “????? ??? ?????? ? ???????”. ?? ??? ????? ?????… ??????????. :(

??????, ???????!!! ? ??? ????? ???????. ???????? ?? ?????? ?????? ?????? ?????, ??? ?? ? ?? ????? ?? ????????????? ?? ?????????? ???.

42 CaseyFronczek June 21, 2009 at 9:32 am

I saw that Casey Fronczek is offering fishing trips now down in south Florida. Does anybody have any input on these trips or has anyone been on one of these trips before?

43 Justyn June 21, 2009 at 5:13 pm

Hey Ben,
I wish things were “that” simple.
The MAMP servers don’t start. It doesn’t open in my default web browser, OR by clicking on “Open start page” in the MAMP window.

I get as far as this:
Safari can’t open the page “http://localhost:8888/MAMP/?language=English” because it could not connect to the server “localhost”.
My next step would be to:
Select phpMyAdmin from the webpage.

Any pointers?
Would love to hear from you.
Cheers,
Justyn

44 Timothy Dempsey July 1, 2009 at 8:24 am

Ben, noticed your RSS feed subscribe is broken. In Firefox, when I try to subsribe using the RSS icon in the address bar I get the “lost at sea” page.

Looks like you have good content, so you may want to look into this.

Leave a Comment

Previous post: Are you pissing off potential customers?

Next post: 7 things Mac users should know