Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP

WordPress is not just for blogs. WordPress is a highly sophisticated content management system that you can use to develop and manage your client’s professional websites. Best of all, it’s entirely free. To get started it helps to experiment without the hassle of publishing files to the Internet. With a Mac, you already have the basics for an excellent local development environment.

In this tutorial, I will describe setting up a folder on your Mac that you can use to practice building websites with PHP and a MySQL database. Before we begin you will need

  1. a Mac
  2. a text editor
  3. a web browser

Let’s get started.

1) Download WordPress from WordPress.org. Unzip it to find a folder called “wordpress”. Rename it YOUR_PROJECT_NAME (Mine will be called “jay”). Drag it to the Sites folder in your Home directory. For easy access, I’ve added the Sites folder to my Finder window sidebar.

Add the Sites folder to your Finder window sidebar

2) Download the free MAMP software from Mamp.info and install. MAMP stands for Mac, Apache, MySQL and PHP. This app helps manage our MySQL databases in a straight forward way.

Open the app and click “Preferences…”, then select the “Apache” tab to select our Document Root. We want to select the Sites folder located in your Home folder. The path should read /Users/YOUR_MAC_OS_X_USER_SHORTNAME/Sites.

Set up MAMP to use ~/Sites as the Document Root

Once you activate MAMP and get the green lights, test if it is working by opening your browser and going to http://localhost:8888/ You should see the contents of your ~/Sites directory. Remember, we’re preparing a local development environment. “Localhost” means your computer, so no one else in the world will be able to see these files in their web browser.

Okay, MAMP is working, and the MySQL is just waiting for us to give it some database tables. Go to http://localhost:8888/MAMP (must be all uppercase) and click “phpMyAdmin”. Once there, “Create new database” with YOUR_PROJECT_NAME. My database name will be “jay” to match my project.

3) Now we just have to match WordPress with the database. Access the YOUR_PROJECT_NAME folder in ~/Sites and rename the wp-config-sample.php to wp-config.php. Open the file to edit the content. DB_NAME means database name, so enter YOUR_PROJECT_NAME. The DB_USER and DB_PASSWORD are both “root”. Leave “localhost” as the server, as the server is our local computer.

Remember to change the name of this file from wp-config-sample.php to wp-config.php

4) Visit http://localhost:8888/YOUR_PROJECT_NAME and you will see the famous five minute WordPress install. Set up the blog name and email, and you will be given a password. (I copy and paste this generated password to get into WordPress, then change it to something easy to remember right away. I use the same simple password for all my WordPress development sites, since they are not live on the Internet.)

The famous five minute WordPress installation process begins

WordPress is now configured to work on your computer, but will only be accessible locally. The final step is to set up Coda to access the directory.

5) Go to Coda, enter Sites view (Command 1) and “Add Site…”

Nickname
YOUR_PROJECT_NAME
Root URL & Local URL
When developing locally, this will simply be used to generate a thumbnail for you to see your project in Coda. These can be the same URL, e.g. http://localhost:8888/YOUR_PROJECT_NAME
Remote Root
None
Local Root
You may use the “Set…” file browser to find your project folder in the Sites folder, or copy and paste this template: /Users/YOUR_MAC_OS_X_USER_SHORTNAME/Sites/YOUR_PROJECT_NAME/
Connecting, Terminal and Source Control
Do not worry about these. You do not have to configure them for local development.

Setting up your new WordPress site in Coda

Short URL: http://jwr.cc/x/1e


Posted

in

, , , ,

by

Tags:

Comments

19 responses to “Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP”

  1. […] here to see the original: Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP – Jay Robinson Comments0 Leave a Reply Click here to cancel […]

  2. […] Go here to see the original: Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP · Jay Robinson […]

  3. […] billet est une traduction localisée (et testée) d’un article original de Jay Robinson m’ayant bien aidé pour essayer une débauche de thèmes Wodrpess. Et qui […]

  4. […] Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP […]

  5. […] sites I have had on my to do list. I was able to do this with MAMP and this tutorial provided by Jay Robinson. I did not deploy the Coda portion of the tutorial because I did not have $99 burning a hole in my […]

  6. […] Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP · Jay Robinson […]

  7. […] I was looking for a simple tutorial that described how to use MAMP and Coda together for locally developing CMS (php based) systems before making them live, in this instance Cubecart. I searched high and low and couldn’t find anything on the net specific to Cubecart. The best documentation I found was this blog post by Jay Robinson that explained how to setup Coda to work with MAMP for developing WordPress sites. […]

  8. […] Setting Up Your Mac For Local Development Using Coda, WordPress & MAMP · Jay Robinson – […]

  9. […] Na blogu Jay Robinsona możemy dowiedzieć się jak w prosty sposób używać lokalnego serwera i Cody (panic) Coda Panic i Mamp – php local server […]

  10. Super cool tutorial, thanks! ;-)

  11. Thanks for the walk-trough, very useful :)

    Nice site you have here too… will be sure to pop by again!

    Cheers

    /Doug

  12. Thanks so much for this tutorial. As a new Mac user, it was just what I needed!

  13. Lucas

    Hi, is this step necessary if you are planning to create a theme on coda operated on wordpress? Also when I type in this site: http://localhost:8888/YOUR_PROJECT_NAME , it doesn’t show the five minute installation post. is there a problem with the link. I’v checked everything and there isn’t any problem. Please help me. Thank you.

  14. Thank you so much for this info. Will try to set on my mac machine very soon

  15. Thank you Jay! Just used your perfectly helpful tutorial to get a local server set up with MAMP, wp, and Coda on the new Macbook Pro.

    Really appreciate your help.

  16. Thank you!!!! This is the simple and straightforward guide that I’ve looked all over the web for!

  17. Andrew

    Very helpful tutorial. Thanks!

  18. Patrick Janelle

    Thanks for compiling these steps so I didn’t have to sort through all of the user guides from these individual apps to make them work together. These steps are concise, clear and have saved me tons of time. Thanks.

  19. surprised you have no comments on this post. just saying thanks for doing a simple tutorial on this, helps a bunch.

Leave a Reply

Your email address will not be published. Required fields are marked *