How To: Install WordPress Locally in Mac OS X

wordpressMac only:  This guide will show you how to install WordPress on your local computer, which will allow you to test tweaks or modify a theme for your current website without making live changes.

To get started, you’ll need to download the following files:

Step One – Installing XAMPP: Once both downloads have completed, you can install XAMPP by double clicking the .dmg file and dragging the application to your Applications folder.

After installation, double click the XAMPP Control icon, which is located in Applications/XAMPP.  Click the Start button for both ‘Apache’ and ‘MySQL’, after which you will be prompted to enter your administrator password.

mac_wordpress_xampp_settings

Step Two – Configuring WordPress: Now that Apache and MySQL are running, it’s time to configure the WordPress database.  In your browser, navigate to http://localhost/xampp/index and click phpMyAdmin on the left sidebar.

In the phpMyAdmin window, create a new database by entering its name in the Create new database field (“wordpress” will be fine) and set MySQL connection collation to “utf8_unicode_ci”.  When finished, click ‘Create’.

mac_wordpress_phpmyadmin

Step Three – Installing WordPress: Start by extracting the WordPress file you downloaded earlier, which can be done by double clicking the file and moving the ‘wordpress’ folder to /Applications/XAMPP/htdocs.

Once the files have been moved, you need to edit the wp-config-sample.php file located in the ‘wordpress’ folder.  Open the file with your favorite text editor and change the values as shown below (make adjustments if you have changed any naming schema).

mac_wordpress_sql_settings

Note: You will notice that the database password is blank, which is the default setting for XAMPP.  This is a security risk, so only leave it blank if you will be working on your local computer on a private network.  To change your database password, return to the phpMyAdmin panel and choose a secure MySQL password.

When you have made all changes to the file, you must rename it wp-config.php (removing the “sample”).  You can then navigate to your local WordPress site (http://localhost/wordpress/wp-admin/install.php) and start using WordPress as usual!


Posted

in

, , ,

by

Comments

30 responses to “How To: Install WordPress Locally in Mac OS X”

  1. CCC Avatar
    CCC

    in step2 HELP SAYS 404 not found on serever

    1. Ffppmb Avatar
      Ffppmb

      Try removing the sub pages and go to the main site. I just tried it and it worked

  2. CCC Avatar
    CCC

    in step2 HELP SAYS 404 not found on serever

  3. […] Follow this link: Installing WordPress Locally in Mac OS X | Techerator […]

  4. Bill Harrison Avatar
    Bill Harrison

    The final line in the post does not work. (http://localhost.com/wordpress/wp-admin/install.p

    It should say http://localhost/worpress… NOT http://localhost.com/wordpress

    1. Evan Wondrasek Avatar

      Good catch, Bill! The link is now fixed.

      1. DigitalByJess Avatar
        DigitalByJess

        The display is fixed, but the code in the hyperlink still points to .com. Besides that, fantastic article. I appreciate the clear, simple instructions.

        1. Evan Wondrasek Avatar

          Thanks for pointing this out! I’ve fixed the link now.

    2. DigitalByJess Avatar
      DigitalByJess

      I had the same issue, Bill, which was resolved by removing the “.com”. Unfortunately I neglected to read the comments and spent a couple hours figuring it out on my own. Lesson learned!

  5. Bill Harrison Avatar
    Bill Harrison

    The final line in the post does not work. (http://localhost.com/wordpress/wp-admin/install.p

    It should say http://localhost/worpress… NOT http://localhost.com/wordpress

    1. Evan Wondrasek Avatar

      Good catch, Bill! The link is now fixed.

  6. Mark Avatar
    Mark

    Followed your instructions for downloading XAMPP, but after installing, double-clicking only produces the “Getting Started” window and not the XAMPP controls window which enables you to start Apache and MySQL. Any suggestions? -Mark

  7. Lisa Avatar

    Link for XAMPP download is unfound.

    1. Evan Wondrasek Avatar

      Thanks for pointing this out. I have updated the link.

  8. RachelF Avatar
    RachelF

    That was incredibly easy! Thank you! 🙂

  9. mr curious Avatar
    mr curious

    awesome thanks so much!!

  10. […] Check out this tutorial on installing WordPress using Xampp on Windows or this tutorial for installing on a Mac. […]

  11. […] Check out this tutorial on installing WordPress using Xampp on Windows or this tutorial for installing on a Mac. […]

  12. Mary Giugliani Avatar

    I recommend this site to embed more than 10.000 Web radio at any site or blog http://www.findradio.net/findradio-widget

  13. Pontus Löfgren Avatar
    Pontus Löfgren

    Hey! I’ve got a problem that I’m hoping you guys can help me out with, I’m new to mac so it’s probably a simple mistake.

    I’ve installed wordpress and everything seems to be working, until, I want to upload a theme. I choose the .zip file and click “upload” and i get this:

    “Unable to create directory
    /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/uploads/2011/05.
    Is its parent directory writable by the server?”

    / Pontus in Sweden

    1. Evan Wondrasek Avatar

      Hi Pontus,

      I’m not familiar with XAMPP to comment on the specific problem you’re having (although it’s definitely a permissions problem, which may be easy to solve). But it looks like you might be using the wrong approach:

      The error message you posted shows that the theme is being uploaded to your Uploads directory, but themes are actually stored in /wp-content/themes. /wp-content/uploads is meant for media uploads like images, so you may want to read WordPress’s guide about themes: http://codex.wordpress.org/Using_Themes

      In addition to that, you can probably bypass any permissions problems you’re having by extracting your theme directly to the Themes folder. Just extract your theme to /wp-content/themes and it should appear in your Themes directory – no need to upload anything.

      Hope that helps!

  14. Bhanu Avatar
    Bhanu

    did you ever find a solution to it.

  15. Bram Berk Avatar

    worked like a charm thanks for the info

  16. TBee Avatar
    TBee

    Hello! Im very new to tweaking on xampp and i was hoping you could help me.. how come i cannot upload any images to posts/pages? see the attached image.. please help me resolve this problem 🙁 thanks!

  17. Johnn Andersson Avatar
    Johnn Andersson

    Hi guys!

    Awesome guide! I have one problem though: I need to stor my wordpress files in a different directory than the standard HTDOCS since I’m working on a centrally administered computer. This causes problems when uploading images etc. since the applications folder needs a password to be writable. So, how to I configure XAMPP in order to use a different directory, for example the documents folder, and how to I access the wordpress admin features from my browser when using this different directory?

    Some coaching would be extremely helpful for both me and the environment (working on renewable energy.. =) )

    //Johnn

Leave a Reply