WordPress famously promises a “5-minute install”. If you’ve tried to install it on your local Mac, you might give up around minute 9.
This is a Step-By-Step guide to installing and configuring WordPress 3.1 on Mac OS X 10.6 (Snow Leopard).
EDIT 2-25-2014 – If you just want to know how to set up a local web server on your mac, check out this excellent guide. As my article is a little out of date, please consult the above guide for getting your mac AMP hosting environment set up (Apache, MySQL, PHP). Refer back here for WordPress installation and setup instructions.
Having a local WordPress installation will greatly speed up your development time. It’s definitely worth setting up — the problem is that I haven’t found a single resource that tells you how to do it. I intend to fix that.
This article assumes you’re starting from scratch. There are a number of steps to get everything just right. This may look like a long and daunting project, but you should be able to complete everything in under an hour.
If you’re not starting from scratch and you just want to know how to add a second (or third, or fourth) WordPress site on your localhost, read this article on how to Install another instance of WordPress on Mac OS X localhost.
Step 1: Download all the required software.
Download the latest build of WordPress (3.1 as of this writing).
Download MySQL for Snow Leopard.
Download MySQL Workbench (GUI Tool).
You’ll also need a text editor capable of opening hidden files. I use BBEdit. You can download a fully functional demo from Bare Bones Software.
Step 2: Extract WordPress
Copy the “wordpress” folder to your “Sites” folder. In my case the path is:
So, the full path to WordPress is:
Step 3: Edit WordPress Permissions
WordPress runs as user “_www” according to the rules in your httpd.conf (apache configuration) file. WordPress needs permission to modify some files during the installation process. It also needs permission to download and install plugins and updates, so it’s best to get the permissions correct now and save yourself some trouble later.
Open terminal and enter the following commands:
sudo chown -R _www wordpress
sudo chmod -R g+w wordpress
(Change the path on the first line to your Sites folder)
Step 4: Edit your httpd.conf file
Open the httpd.conf file located at
(This is where BBEdit comes in handy, since the folder and file is hidden.)
At line 167 change the path of DocumentRoot to your wordpress folder
At line 194 change the path of “Directory” to your wordpress folder
Enable php by uncommenting Line 115
LoadModule php5_module libexec/apache2/libphp5.so
Save the file. You’ll be prompted for an administrator password.
IMPORTANT: You’ll need to restart Apache before the changes go into effect. Open System Preferences, Click on “Sharing” and toggle “Web Sharing” off and back on. This will reload your httpd.conf file.
Step 5: Install MySQL
Run the MySQL installer package.
Run the MySQLStartupItem package. (This will ensure MySQL starts when you boot up.)
Install the MySQL.prefPane (This installs a System Preference Pane that allows you to start and stop MySQL.)
Install MySQL WorkBench (a Graphical User Interface for working with MySQL).
Step 6: Configure MySQL
(This is the longest step in the process. Just follow along!)
Open MySQL Workbench (which should now be in your “Applications” folder).
Step 6a: First, Create a new connection.
Click on the “New Connection” button.
Name the connection “localhost”.
Leave everything else as default.
Next, double click “localhost” to open a connection
Step 6b: Create a new schema.
Click the new Schema icon:
Name the new schema “wordpress”.
Close this tab to return to the main window.
Step 6c: Create a new server instance.
Under “Server Administration” create a new server instance.
This will start a Setup Wizard that will walk you through the process of setting up the server instance. Leave all the default settings as they are.
As the wizard proceeds, you may get the error:
Checking command ‘ps xa | grep “/usr/local/mysql/bin/[m]ysqld”‘
Server detected as running
Check if /etc/my.cnf exists locally
Operation failed: File /etc/my.cnf doesn’t exist
Don’t be alarmed. Continue hitting “next”. MySQL will create the required my.cnf file.
Step 6d: Create a new database user for WordPress
It’s generally not wise to run anything as root. So let’s create a new user for WordPress:
Under “Server Administration” you should now see a new database server instance called “mysqld@localhost” (or similar). Double click this instance.
On the resulting screen, click on the “Accounts” tab.
Click the “Add Account” button (bottom left).
Now, there are three tabs (“Login”, “Administrative Roles”, “Account Limits”). Under the “Login” tab, name the account “wpuser” and create a password (enter it twice).
Type “127.0.0.1” into the field labeled “Limit Connectivity to Hosts Matching:”. THIS IS IMPORTANT! If you don’t do this step you will get a connection error later when trying to install WordPress.
Under “Administrative Roles” check the box “DBA”.
Next click on the tab labeled “Schema Privileges” (Just above the three tabs “Login, Administrative Roles, Account Limits”).
Select the user “wpuser”
Click the “Add Entry…” button.
For host, leave “Any Host” selected.
For schema, choose “Selected Schema:” and pick the “wordpress” schema (the database schema you created in Step 6b).
Next, select the account name, and click the “Select “ALL”” button, and then “Save Changes”.
Now, MySQL should be configured correctly and you’re ready to install WordPress!
Step 7: Installing WordPress (Finally!)
Okay, by now you’ve downloaded WordPress, copied the files to your “Sites” folder, modified the permissions, modified your httpd.conf file, installed MySQL and created a database and user for WordPress. Whew!
Now you’re ready for the fun part!
Point your browser to http://127.0.0.1/wp-admin/install.php
WordPress will now ask you for the following information:
Database Name: wordpress
User Name: wpuser
Database Host: 127.0.0.1
Table Prefix: wp_
By default, WordPress fills in the “Database Host” field with “localhost”. I’m not sure why, but this doesn’t work! (At least not in WordPress 3.0.) You’ll get a database connection error unless you use 127.0.0.1.
If your wordpress folder permissions are correct, the installer will be able to save the wp-config.php file. Next, all you have to do is enter few more details and you should be using wordpress in no time.