How to Install WordPress with MAMP for Local Development

How to install WordPress with MAMP.

MAMP allows WordPress developers to develop quickly and safely directly on their computer without an Internet connection or the hassle of managing the individual programs that WordPress requires to run.

In this post, I’ll share how to install WordPress with MAMP in order to kick up your local development style.

What is MAMP?

MAMP is a free, downloadable web development application that can be installed on a macOS or Windows operating system. The program gives you local access to an Apache server, which is a web server software that bridges the gap between PHP and web browsers.

MAMP is free and simple to download.

Macintosh, Apache, MySQL and PHP (MAMP) are the four components that are bundled together to create the MAMP program:

  • Macintosh – MAMP was originally built to run on the macOS operating system, but it can now also run on Windows. For details, check out WAMP, LAMP, or XAMPP.
  • Apache – An open-source cross-platform web server.
  • MySQL – An open-source relational database management system.
  • PHP – The server-side scripting language on which WordPress is built.

Why MAMP?

Local WordPress development with MAMP has a variety of excellent benefits that can help you optimize your development process. Using MAMP means you can:

  • Develop locally on your own computer.
  • Work without needing internet access.
  • Keep your local install as a partial or full backup.
  • The lack of an internet connection increases your security a little and also the speed of your machine.

For details, check out WordPress Local Development: What It is and When to Use It.

Getting More with MAMP PRO and MAMP Cloud

MAMP has a premium version called MAMP PRO that has a variety of extra features such as unlimited hosts, configurable web servers, easy WordPress installation and migration, and much more.

Additionally, with MAMP PRO you’ll get the recently introduced MAMP Cloud, which is also available on MAMP as a trial.

MAMP Cloud allows you to save and load your host and data from one database using Dropbox. This means you can work from any computer you need to – a real plus for digital nomads.

Installing MAMP

To install WordPress with MAMP you’ll first need to download the application from the MAMP website.

The process is outlined below using a Mac.

Click the Free Download button on the front page and you’ll be taken to the Downloads page.

Select the MAMP version you need.

To use the latest version of the software MAMP recommends running macOS 10.10 or later. If you’re running an older version of macOS, click the Older MAMP & MAMP PRO versions link.

Once you download the package, click the package icon to launch the installer. Walk through the installation setup until MAMP is installed.

MAMP’s installation wizard makes installation effortless.

After you have installed MAMP, you can find it in your Applications folder. MAMP PRO comes bundled with a limited trial version so you will see that icon as well.

Make sure to click the MAMP folder instead of MAMP PRO.

Open the MAMP folder by clicking the icon. You can start the actual program from here. This folder is also where you’ll access your future WordPress files.

In Applications, the MAMP folder will include the icon to launch the program.

Click the elephant icon to launch MAMP.

The MAMP application window will appear with options to try MAMP Cloud as well as the button you’ll click to Start Servers later. The server status lights in the upper right corner will let you know when the servers are running by turning green.

Until the servers are turned on, the status lights will stay gray.

Before starting the servers, check and set MAMP’s settings.

Setting Ports

A port allows multiple server programs to run on a single machine. Each individual port, designated by a number, is a place to transmit and receive data through a specific program.

MAMP Ports

The default MAMP ports are 8888 for Apache, and 8889 for MySQL. When you turn on the MAMP servers and access your local server through your web browser, you’ll need to include the Apache port number in the URL.

The URL will be: http://localhost:8888.

Alternatively, if you don’t want a port number in the URL, you can switch the Apache port to 80 and MySQL port to 3306. This will make the local server URL http://localhost.

The only downside to this configuration is that you’ll always be asked for your Mac’s administrator password when starting the MAMP servers.

To switch your ports, click on MAMP in your Mac’s top navigation bar then select Preferences. Then, click on the Ports tab.

After opening MAMP > Preferences, click on the Ports tab.

You can update Ports by either selecting and changing the port numbers directly or by clicking one of the Set MAMP ports to default or Set Web & MySQL ports to 80 & 3306 buttons.

Changing Your Document Root

While you’re still in Preferences, you can change the Document Root for your local MAMP files. This doesn’t change the location of the MAMP application itself but rather where MAMP can find your local website files.

The default Document Root folder on your computer is Applications > MAMP > htdocs. You can change this by going to the Web Server tab and clicking Select.

Change the default Document Root for your MAMP website files by clicking the Select button.

Once you have completed your Port and Web Server customizations, click OK.

Start the Servers

Click the Start Servers button on the MAMP panel. Setting your ports to 80 and 3306 will prompt you to enter your Mac administrator password.

If the servers successfully turn on, the server status lights on the MAMP panel will turn green and the MAMP start page should open in your default web browser. If it doesn’t open, click the Open Start Page in the MAMP panel.

How to Install WordPress with MAMP

Now that MAMP is installed and setup, the final task is to install WordPress with MAMP.

Create a Database

The first step to install WordPress with MAMP is to create a MySQL database. On the MAMP start page in your web browser, select Tools > phpMyAdmin.

PhpMyAdmin is a software tool that lets you access and manage all of your website MySQL databases.

Select either New in the left-hand sidebar or the Databases tab. Under Databases > Create database, enter a name for your database, preferably in all lowercase letters and with no spaces.

Don’t change the collation setting as MySQL will automatically assign it during the WordPress installation process.

Use phpMyAdmin to create a database that will be used to install WordPress with MAMP.

Select Create to generate a new database.

Download WordPress

We’ll install WordPress with MAMP manually so download a fresh copy from WordPress.org.

Move the downloaded ZIP file to your document root folder and unzip it. This folder will be Applications > MAMP > htdocs if you kept the default MAMP setting.

Once unzipped, the folder created will be named “wordpress.” You should rename it to be more relevant to your website.

Set Your Timer

You’re now ready for the famous 5-Minute Install. In a web browser, enter the localhost URL followed by the name of your newly created folder.

Depending on your port settings, the URL will be http://localhost:8888/your-folder-name or http://localhost/your-folder-name.

Next, you should be greeted with the WordPress logo and the option to choose your language.

Select your language and click Continue.

Seeing this page means you have correctly started the WordPress site installation process.

Then, WordPress will welcome you and let you know what details you need to proceed.

Using this installation method isn’t crucial, but it can be easier than editing files directly.

If you prefer changing your credentials in your wp-config.php file, you can do so at this time.

Otherwise, click Let’s go!

This WordPress screen lets you know the process ahead for connecting your database.

You’ll be brought to a screen to enter your database connection details.

Enter the following information:

  • Database Name – Name of the database you created in phpMyAdmin
  • Username – root
  • Password – root
  • Database Host – localhost
  • Table Prefix – Can stay as “wp_” or be changed to something else in order to improve security as well as to distinguish between multiple WordPress installations
Enter the applicable details to connect WordPress with your new database.

Click Submit.

WordPress will let you know that it’s connecting with your database, then click Run the installation.

After WordPress gets in touch with your database, it’s time for the site to install.

Input your Site Title, Username, Password and Your Email.

Input your Site Title and account credentials.

Finally, click the Install WordPress button.

Afterward, you’ll receive confirmation that you can log in to the site.

You can log in to your new local site by visiting one of the URLs below, depending on your MAMP settings, as previously mentioned:

  • http://localhost:8888/your-site-folder-name/wp-admin
  • http://localhost/your-site-folder-name/wp-admin

MAMP It Up

After you install WordPress with MAMP once, the process becomes more straightforward each time.

You can locally host a whole army of websites on this development server thanks to its lightweight nature and powerful stack.

Have you ever installed WordPress with MAMP before? What do you look for in a local development application? Let us know in the comments below.

FURTHER READING