Testing new WordPress themes, plugins, or upgrades before implementing it live on the Internet is a great way to streamline your workload as a web designer and developer. For example, if you want to create a new WordPress theme from scratch, it’s best that you develop the theme on your local server before you release it. Because once it goes online, who knows what can happen.
Quick Run Through
This tutorial requires that your computer is running Mac OS X. If you are on a Windows PC, read this article by Six Revisions on how you can install XAMPP on your computer.
- Download MAMP and WordPress.
- Install MAMP to the Applications folder.
- Extract the contents of the WordPress zip file and upload them to ‘/Applications/MAMP/htdocs/’
- Go to PhpMyAdmin and create a new database
- Edit the wp-config-sample.php file with the appropriate database information. Rename the file to wp-config.php
- Go to http://localhost:8888/ and you will be redirected to the WordPress install.php file. Follow the directions and fill in the required information.
Install MAMP and WordPress
Install MAMP into your Applications folder
Upload the contents of the WordPress folder to your development folder
Create a new database for WordPress in PhpMyAdmin
Run the WordPress Installation
WordPress installed, MAMP running, now what?
MAMP is an abbreviation for Mac+Apache+MySQL and PHP. These are the basic tools you need set up to be able to host a local web server on your computer.
MAMP also comes with a Pro version, retailing at $50. One notable feature is the ability to run multiple websites locally with their own unique web address and folder structure.
Your Mac also comes preinstalled with its own local web server called iWeb. Kudos to you if you already know this.
You can download the latest version of WordPress here.
Once you finish downloading MAMP, install it to your Applications folder like any other program.
In this step, you can set up WordPress wherever you like. I put WordPress in my Dropbox folder so that the files are always backed up securely. By default, MAMP will look in your ‘/Applications/MAMP/htdocs/’ directory. If you decide to place WordPress elsewhere, make sure you make the appropriate changes in your MAMP preferences like I did below:
WordPress needs a database to store its content and to be able to run properly. You can create a new database via PhpMyAdmin by going to http://localhost:8888/phpMyAdmin/. It should look like this:
Create a database where it is indicated. You can name it whatever you like. I named mine “wordpress.”
You will need to update your database information in the wp-config-sample.php file, which is found in your downloaded copy of WordPress. Locate this inside the file:
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'database_name_here'); /** MySQL database username */ define('DB_USER', 'username_here'); /** MySQL database password */ define('DB_PASSWORD', 'password_here'); /** MySQL hostname */ define('DB_HOST', 'localhost');
Replace ‘database_name_here’ with the name of your database. Replace both ‘username_here’ and ‘password_here’ with ‘root’
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', 'root'); /** MySQL hostname */ define('DB_HOST', 'localhost');
Then, save the file and rename it wp-config.php.
Alternatively, you can simply head to http://localhost:8888/, or its equivalent, and WordPress will help you setup the necessary configuration to have your website up and running.
Since Apache is found in port 8888, go to http://localhost:8888/ in your web browser. This will redirect you to the wp-install.php file located in your WordPress files. There, you’ll find the familiar instructions for you to install WordPress on your computer. Rejoice! The battle is essentially over!
For starters, your local WordPress site needs some dummy content to work with. What? Did you expect to meticulously copy and paste some lorem epsum all day? Heck no! Go over to WPCandy and download their sample WordPress content here.
Don’t like reading? I understand.
If you merely skimmed this article and would rather see a live demo for yourself, check out this video on how to install MAMP on your computer. Cheers!
Unlike XAMPP, MAMP has a far simpler interface, which makes it incredibly easy to use. Lend me your thoughts…do you use MAMP or something similar for WordPress development?