When designing WordPress themes, it’s nice to be able to store them locally to test them instead of uploading files to a web server (though Transmit makes it quite easy). In this tutorial, you’ll learn how to set up WordPress locally on your Mac and then manage multiple blogs with their own themes.
Note: A shinier, updated version of this tutorial can be found here.
The first thing you’ll need to do is make sure you have MAMP installed and running on your Mac. If you don’t, follow this tutorial first, and come back here when you’re done.
Next, you’ll need to have the latest version of WordPress.
After MAMP is up and running, drop that latest version of WordPress into the folder that your sites are stored in. For example, the htdocs folder in the MAMP Applications folder (default), or the folder you specified, such as Users/Username/Sites.
Next, we need to create a database so we can run WordPress. Open up the MAMP Startup page (there is a button on the control panel window), and go to phpMyAdmin.
In the MySQL column, there is a table for creating a new database.
After your database is created, open up the ‘wp-config-sample.php’ file in the root WordPress folder. Change the database name to ‘wordpress’ (or whatever you called your database). Both the username and password are ‘root’, and the host is localhost.
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'root'); // Your MySQL username
define('DB_PASSWORD', 'root'); // ...and password
Save this file as a new file with the name wp-config.php.
To install WordPress, open up wp-admin/install.php. From there, it’s the standard, simple WordPress installation.
Once installation is finished, you can view your blog at http://localhost:8888/WordPress/. Of course, the Dashboard is located at wp-admin/.
If you want to run multiple blogs with their own themes, all you have to do is repeat this process, and give each database a new name. You can use the same database if you like – some people prefer to have certain sample posts to test things.