How to Run WordPress Locally on a Mac - ManageWP

How to Run WordPress Locally on a Mac

As a website developer, there are times when you don’t want to be chained to your desk.

Instead, you’d prefer to take your work to a café, a park or anywhere, just for a change of pace. Or perhaps you want to test out a plugin that was brought to your attention by a peer or client. This article is going to introduce you to a development environment you can install on your Macbook, so you can work from virtually anywhere you want to.

So, how do we make this magic happen? It’s quite simple actually. As with most things development based,there’s a piece of software that makes it possible. For us Mac users, that software is MAMP (Mac/Apache/MySQL/PHP).When installed, MAMP allows you to locally run a webserver on your machine with access to a MySQL server and PHP.

While there are other ways of achieving the same result– like manually installing Apache, MySQl and PHP – this the quickest and most efficient way to do it. Welcome to developer freedom, folks! (You can thank me later.)

Setting up MAMP on your Mac

MAMP comes in two different flavors: a premium paid version and a free version. The free version is typically all you’ll need, as it comes with the full suite of web software needed to run most websites.

You can download it from here.

Then, locate the file from your downloads folder – it will be named something like MAMP_MAMP_PRO_3.0.5.pkg (the numbers may be different as they represent the current version number) – and install it like you would any other piece of software.

And now you have your very own living, breathing web server on your laptop. All you need to do now is learn how to use it.

Starting up and using MAMP

You’ll find your installed software package in your Applications folder.

You’ll see two new icons: one for MAMP and one for MAMP Pro. You can ignore or delete the MAMP Pro icon, we only need the MAMP icon for this article. Double click the MAMP icon to bring up the dashboard widget.

MAMP Dashboard Widget
A couple of quick points: Firstly, you can tell when the apache and MySQL servers are working by looking at the upper right hand corner. A green box beside each indicates that the particular server is up and running as expected. Secondly, you can’t close the widget without shutting down the servers, so just minimize the window to get it off your screen.

You can also go through the setting found under the preferences button on the widget, but MAMP works quite smoothly out of the box and you shouldn’t need to make any changes.

The next thing you will want to do is get to the start page by clicking on the button aptly labeled Open Start Page.
MAMP Start Page

On this page, there’s basic information on MAMP and its different components. You’ll be usingthephpMyAdmin feature – found under the Tools menu – for the majority of the time.

Using phpMyAdmin

phpMyAdmin is used to set up, manage and work with MySQL databases. I know that on the surface it seems strange to use a tool with ‘php’ in its title to manage MySQL databases. However, it’s a very powerful tool once you get the hang of it.

I’m now going to walk you through setting up a database and a user so you can install and run WordPress on your local machine (aka your laptop or desktop). You’ll need to do two things:

  1. create a database, and
  2. create a user that has privileges on that database.

So lets start by creating the database, which is a remarkably simple process.

If you click on the Databases tab you will see a Create Database field where you simply name your database and click the Create button. You can most likely ignore the dropdown menu located after the name field, as the default will apply in most instances.

Next up, we need to create a user that has privileges to access and work with the new database. Click on the Users tab in phpMyAdmin and then find the link to Add User.

phpMyAdmin

Simply choose a username, select Local from the dropdown and type in and confirm a password. This will set up a user for the database, but we still need to configure the privileges this user has. If you’re familiar with MySQL databases, you can determine which individual privileges to check off in the Global Privileges section – or you can simply select the Check All box and grant global permission to the user. This is fine for a site that is non accessible to the public.

Now that we have a database and a user who can access it, it’s time to get a WordPress website up and running.

Installing WordPress

If you have ever installed WordPress on a hosting provider’s site, you must know that FTPing the files can take a few minutes. One of the nice things about working locally is how quickly you can have a new WordPress install up and running.

Here’s how I go about installing WordPress:

  1. Create a new folder in the htdocs directory of your MAMP installation. This is where all of your sites will live. The name of this folder will become your site name for step three below.
  2. I keep a copy of the latest version of WordPress unzipped and ready to go on my hard drive. Simply copy and paste all of the files from the WordPress folder into the one you’ve created for your site.
  3. Open a browser of your liking and navigate to localhost:8888/yoursitename/wp-login.php and run through the (less than) 5-minute-long installation process.
  4. Once you’ve done that, presto! You now have a fully functional WordPress install/site to work on at your leisure!

This should take away any hesitation you might have about installing a web server on your Mac OS laptop or desktop. Enjoy!

Tom Ewer

Tom Ewer is the founder of WordCandy.co. He has been a huge fan of WordPress since he first laid eyes on it, and has been writing educational and informative content for WordPress users since 2011. When he's not working, you're likely to find him outdoors somewhere – as far away from a screen as possible!

9 Comments

  1. Bob Brooks

    Got this error for Step 3: The requested URL /WordPress/wp-login.php was not found on this server.

    1. Bob Brooks

      I figured it out. Thanks.

  2. Greg Raven

    It’s easier and better to use Bitnami.

  3. Aakash

    It sounds similar how you install WordPress on Windows. I wonder installing on MAC is so similar process.

  4. Naba Now

    thank you So Much for your Helpful Information.

    1. Tom Ewer

      You’re welcome!

  5. Yves

    Thank you for this tutorial. I guess you will publish another post to teach us how to “deploy” live the local website on the Internet?

    1. Tom Ewer

      You’re welcome Yves. There’s always a possibility for that on a future post. :)

    2. Nemanja Aleksic

      I think I can help out with that one: The ManageWP tutorial covers all the steps to deploy a site from localhost to Internet and vice versa

      https://managewp.com/user-guide/faq/clone-from-to-localhost-using-port-forwarding

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Over 27,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 27,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 27,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 27,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!