1. Download and Unzip WordPress
Go to WordPress official download center and download the latest version zip file of WordPress.
To unzip your WordPress, just double-click the zip file you downloaded and you will see a folder named wordpress.
2. Download and install MAMP
MAMP is like the container to hold your WordPress website.
Go to MAMP website to download the latest version of MAMP. MAMP Free version is good for most cases. So just click the button in the red circle.
To install MAMP, just double-click the .pkg file you downloaded from the website and follow the steps without changing anything.
3. Move your WordPress into MAMP
Now just move your wordpress folder into MAMP so you can install it afterward.
First, go to your wordpress folder and select ALL the files in it. Right-click to copy all items in that folder.
Now go to Applications/MAMP (the gray one)/htdocs/ and on the last column, right-click to Paste Item into that column.
Finally, you will see your folder like this:
4. Launch your MAMP
Now it’s the exciting part. Double-click MAMP icon to launch it.
Click button Start Servers and once it finishes spinning, a new web page will show up on your screen.
Once you see the WebStart page like the following, just click My Website so you can install your WordPress.
5. Error establishing a database connection
To set up my WordPress, I set Database Name to info30_db, username to root (this is very important to name it “root” rather than other usernames) and password to root. I left Database Host and Table Prefix as default.
But then I had a problem saying Error establishing a database connection:
In short, this means that I missed something during the installation process. Think about in this way, how come I can set up the database without creating one? So, the answer is we need to set up a database.
6. Set up database for your WordPress
Visit the URL http://localhost:8888/phpMyAdmin and you will reach the landing page for tool phpMyAdmin. It’s a tool looks like this:
Type the database name you entered in the last step. In this case, I typed info30_db so I kept the same here:
7. Config the wp-config file
Go to the path Applications/MAMP/htdocs/wp-config-sample.php
Open this file with TextEdit or Sublime Text and edit it with your own information.
Finally, save this file.
8. Let’s install WordPress again
Now go back to Step 5 where you type all your information like this:
Then click Submit button and you will see this page:
Next, you need to create your admin username and password in order to log in to WordPress dashboard.
SUCCESS! Once you see a page like the following, it means that you successfully install WordPress on your local machine!
9. Login to WordPress Dashboard and Preview your website
Visit the URL http://localhost:8888/wp-login.php and log in with username and password you set. You will see the dashboard like this:
Your website can be reached at http://localhost:8888/
Enjoy! If you have any problems during the installation, just leave me a comment and I’ll response as soon as possible.