Skip to main content

Installing Wordpress Locally with MAMP

··2 mins

Install MAMP #

You’ll need to grab the installer for MAMP and install it. You’ll want to use the MAMP installer and not the MAMP Pro version that also comes installed.

Boot up MAMP #

Find MAMP in your applications and start the app. Then click on the ‘Start Servers’ to initiate the MySQL and Apache server.

By default the servers are handled on port 8888. You can access phpMyAdmin for your databases.

Creating a Database #

Go to your phpMyAdmin and then create a database by clicking on the Databases tab. If you’re importing a database this should be the same name as that database.

After creating this, you’ll either need to import a SQL or ZIP file under the Import tab, or run the Wordpress installer (see next section).


Installing Wordpress #

Download Wordpress and then install it in a new directory under /Applications/MAMP/htdocs (i.e. /Applications/MAMP/htdocs/wordpress).

You should then be able to access your new install at http://localhost:8888/wordpress.

Getting imported installs to work #

If this is not a fresh install, you may need to change a few things to get it working.

Check your wp-config.php to make sure that the DB username and password are the same as their non-local counterpart. Otherwise change them in phpMyAdmin and update the wp-config to reflect.

You’ll more than likely have to override the site URL and home page, as it will otherwise point to whatever URL was initially set in the database. Copy the following wp-config snippet below to do so.

define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/your-directory-name' );

define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/your-directory-name' );