There are plenty of ways to install WordPress on your local machine. I use a free software package called AMPPS.
It’s similar to packages like MAMP and XAMPP in that in includes all of the things you need to run WordPress: PHP (the programming language), MySQL (the database), and Apache (the web server). That’s what some of the As, the Ps, and the Ms stand for in these acronyms.
While I use a Mac, note that AMPPS is also supported on Windows and Linux. Instructions may differ slightly for non-Mac users, but the core concepts are the same.
Step 1: Download and Install AMPPS
For our purposes, we’ll avoid the “PHP Dev Package” and download the latest version of AMPPS.
The latest version (at the time this tutorial was last updated) is 3.6. The download is a few hundred megabytes, so it may take a while on a slower connection.
Select the appropriate download depending on your operating system. If you’re a Linux user, you’ll need to select between the 32bit or 64bit packages.
Install it like you would any other application. Since I use a Mac, after downloading, I’ll mount the DMG file and drag the app into my Applications directory.
Step 2: Start Apache and MySQL
After installing, open the app. You’ll be greeted with the “Control Center.”
Start both Apache and MySQL by clicking the green buttons under each column.
You’ll see success messages in the status window below, but to make double sure it’s working, type http://localhost/ into your browser’s address bar.
In some browsers, you may be able to get away with just typing “localhost” but since many browsers combine their address bar with a search engine, it might get confused and try to search for “localhost” instead. So prefixing “localhost” with http:// is a good habit to get into.
At this point, you have a functional web server running locally on your computer.
http://127.0.0.1 will also work like
http://localhost/ and can be used interchangeably. This is known as the loopback IP address.
Step 3: Choose a fake domain
If we really wanted to, we could use a URL like http://localhost/wordpress/ for our locally hosted WordPress site, but we’ll go ahead and install WordPress on a more realistic-looking domain.
To get started, click the house icon in the AMPPS Control Center to access AMPPS Home.
You can also access AMPPS Home by typing the following URL into your browser’s address bar: http://localhost/ampps
If you can’t access it, refer back to step 2 and make sure Apache and MySQL are running.
Once on the AMPPS home screen, click on the “Add Domain” link.
Reserved domain extensions for testing
There are four reserved domain extensions for “testing and documentation examples” according to this.
To avoid conflicts with potentially real domains (like .dev, which is a popular one for local development) you should use one of the above.
For example purposes, we’ll use the following fake domain:
Step 4: Add the fake domain
On the “Add Domains” screen (which can also be accessed by typing
http://localhost/ampps/index.php?act=ampps_domainadd in your address bar, but it’s nice to know other ways of getting there) we’ll type in our desired domain.
You’ll notice as you’re typing, the “Domain Path” field fills out to match. This is the folder where we’ll later add our WordPress files, so take note of this path. On a Mac, it will be the following:
Keep all the other settings on their defaults, as seen in the screenshot:
- Is Domain Addon or Parked? Checked
- Add an SSL entry? Unchecked
- Add an entry to Host File? Checked
Then click “Add Domain” to add the domain. At this point, typing http://wordpress.localhost/ into your browser will lead to a page with an empty directory index (except for a
/cgi-bin/ directory, which you won’t need).
Even though just “wordpress.localhost” may all be that’s necessary, prefixing the domain with http:// is a good practice so browsers don’t get confused and attempt to run it through a search engine first.
Step 5: Download WordPress and unzip in your directory path
Grab the latest WordPress core files from WordPress.org, and extract them in the directory path we chose above.
As a reminder, that path is:
A quick way to find it on a Mac is to type your chosen domain into Spotlight search, and select the first result.
After extracting the files, our directory structure should look like this:
Also after extracting the files, we’ll be greeted with the WordPress installation screen by typing our domain into our browser’s address bar.
But before we go through the installation process, we need to set up the database.
Step 6: Set up a database in phpMyAdmin
AMPPS also includes phpMyAdmin, which can be accessed at the following URL: http://localhost/phpmyadmin
We’ll use it to create the MySQL database we need for WordPress to run.
First, click the “New” link at the top of the left sidebar.
For example purposes, we’ll use wordpress. You can use whatever you want, just keep it mind for the next step.
Once you’ve chosen your database name, type it in and click the “Create” button.
Now close out of phpMyAdmin, and let’s head back to the WordPress installation screen at
Step 7: Connect to the database
On the previously pictured language selection screen, select the language of your choice and click the “Continue” button.
For example purposes, we’ll select English (United States).
Click the “Let’s go!” button on the next screen, as we already have all the database information we need.
On the database credentials screen, input the following information:
- Database Name: wordpress (or whatever you chose in Step 6)
- Username: root
- Password: mysql
- Database Host: localhost
- Table Prefix: wp_
We’re playing things fast and loose since we’re on a local environment and we want to keep things as simple as possible for this tutorial, but it is not a good idea to use the root MySQL user on a live server, if you have the option. Many hosts don’t allow it.
In the background, WordPress will create a wp-config.php file with the information WordPress needs to connect to the database.
After successfully connecting to the database, you’ll be prompted to finish the installation by specifying your WordPress site details.
Step 8: Finish installing WordPress
Fill out your choice of site title, username, password, and email address on the next screen.
Search engine visibility doesn’t matter because this WordPress website will not be accessible from the web, but feel free to further discourage search engines from indexing your site just for kicks.
After clicking the “Install WordPress” button, you’ll be redirected to the WordPress dashboard of your newly installed local WordPress site.
Your locally-installed WordPress site is now fully functional!
Like I mentioned in the first sentence in this post, there are plenty of ways to install WordPress locally.
I’m not going to argue about which way is the “best” because it’s something that I’m just not that opinionated about. AMPPS works, and I’m comfortable with it. So I use it.
Plus as a theme developer, I don’t particularly care about exact parity between local and live environments, since my themes will be used on many different types of environments that I can’t anticipate. It sometimes even helps me when an error is thrown on one environment, but not the other, because I can look into why and eliminate it.
If you have any suggestions on what local development environment tool I should try next (and write a similar tutorial about), I’m all ears!
Also, would you prefer video tutorials?