Quick Summary
Here are the simplified steps on how to install WordPress on your local computer:
- Install a local server ( XAMPP).
- Create a new database (phpmyadmin).
- Setup XAMPP Security
- Download WordPress from wordpress.org and extract the files to a new folder under the htdocs folder (typically C:xampphtdocs).
- Run the famous 5 minute install and follow the instructions: wp-admin/install.php.
- Done!
Before You Get Started
WordPress needs PHP and mySQL to run. This tutorial installs via XAMPP, not WAMP or MAMP (Mac), so I will not be going into any details regarding WAMP or MAMP, but some of the things will apply to them as well.
1. Install XAMPP, a Local Server
In order to run any PHP/database application on a local computer, you need a local host (ie. Apache + MySQL). So go and download the most recent version of XAMPP or the version from this tutorial is XAMPP 1.7.4-VC6 (Sourceforge Old Versions, Windows Version). I selected to have Apache and mySQL installed as a service and not FileZilla since I already have that installed.
2. Create a New Database
After you’ve installed XAMPP, run it by opening a browser and going to localhost. It should take you to the start page, http://localhost/xampp/. Now click on phpMyAdmin. In the phpMyAdmin page, create a new database. Since this is local anything will do (eg. wordpress). However, you want a more complicated database name than this to protect yourself from SQL injection on the internet.
If when you install it, port 80 is busy. You want to navigate to your XAMPP directory (e.g., C:xamppapacheconf) and open the file httpd.conf in your text editor. On line 45, you’ll find:
#Listen 0.0.0.0:80 #Listen [::]:80 Listen 80
To change it to port 8080, simply make this change:
Listen 0.0.0.0:8080 #Listen [::]:80 #Listen 80
Then later, on line 176, you’ll see:
ServerName localhost:80
Change it to:
ServerName localhost:8080
If you switch to port 8080, you’ll need to to always go to it via localhost:8080. Furthermore, WordPress will not allow you to enable multisite with a port number trailing localhost. So if you can have XAMPP take port 80, which may mean that Skype will need to be changed to another port. It will redirect you to http://localhost/xampp/ or http://localhost:8080/xampp/.
You’re host directory will be C:xampphtdocs based on httpd.conf. If you wish to change it, simply find it in httpd.conf on line 183 and make whatever changes you’d like. Now go to phpMyAdmin, and create a new database (eg. wordpress) by typing in your database name (e.g. wordpress) and pressing CREATE.
3. Setup XAMPP Security
Go back to localhost or localhost:8080 in your web browser. Click on security and it will open a new window/tab to http://localhost/security/index.php or http://localhost:8080/security/index.php. Then click on the link: http://localhost/security/xamppsecurity.php. This will allow you to change your mySQL password and .htaccess password. Since this is typically my sandbox for breaking things and developing code, I just enter a mySQL password. Click password changing and you will receive a message: The root password was successfully changed. Please restart MYSQL for loading these changes! Then close the window/tab.
4. Download WordPress
Go to wordpress.org and download the latest build of WordPress. Go to the htdocs folder (where you installed the XAMPP), extract the wordpress.zip to a new folder (eg. mywordpress).
5. Run the Famous WordPress 5-minute Installation (install.php)
With your browser, go to http://localhost/mywordpress/wp-admin/install.php or http://localhost:8080/mywordpress/wp-admin/install.php, click Create a Configuration File and click Let’s go! Fill out Database Name (eg., wordpress), User Name (needs to be root), Password, Database Host, and Table Prefix (it is always a best practice to change the default wp_ prefix to something else). Be sure the User Name is the same as your mySQL username, “root”. Then click Run the Install, and follow the instructions to install WordPress. Fill in the Site Title, Username, Password twice, and email. Then click Install, and then Login.














Hi Travis! Very helpful tutorial. Am curious as to why you’re recommending to change the database prefix from the default wp_. This is the second place I’ve seen that recommendation, but no explanation.
I plan to do multiple installs, and I’m wondering if it is fine to use any consistent db prefix (such as db_site1, db_site2, db_site3. Although rather than use such generic name/numbers I’d create more descriptive names, to help me identify the databases on the fly –without having to consult an org chart).
And shouldn’t there be something in the name that identifies them as WP databases? Just in case, later, I had to create straight MySQL databases for some other web use?
Thank you,
Paula
Yes, I recommend some complicated combination that only you understand that identifies the database. Many hosts like Hostgator in shared hosting will apply prefixes to your database for you (typically your username_yourdatabasename). Now for db_site1, db_site2, etc. that’s a great idea and if you are using WordPress 3 MS, then something like this is done for you on the table level.
I did find an answer to the above question, having to do with avoiding the malicious intrusion known as SQL injection. I have another question: Do you have to use the same username/password for the MySQL database on the host server as on the local server? (I am assuming this answer is “no,” but thought I’d double check with someone more expert.)
Thank you!
Paula
Yes, it is because of SQL injection, and no, they are not any different as the host on the server is generally configured to localhost anyways.
hey how to use filezilla to load plugins and themes on ur localhost…..
You don’t. You only need to use FileZilla to upload to WordPress that are hosted on servers as an FTP option. To use on your localhost, you can use Windows Explorer or whatever the Mac equivalent is. Now, WordPress is installed as localhost in wp-config.php:
/** MySQL hostname */ define('DB_HOST', 'localhost');So if it is located on a site like domain.com, then you would need to use FileZilla. Download FileZilla. In Hostname, put ur domain.com, then insert your username and password and click QuickConnect. Your hosting provider should have some information on how to setup your FTP site.
Hello I’m just trying to insta wp to my comp(very new to it) not make it public I want to be able to mess up and only I can see it .do I need a host?a domain name? I got a host and a domain name but I’m lost can you help me?
No you don’t need a host and a domain name to install locally. This post tells you how to do what you are looking to do.
Hello I got camp installed. Changed pw on php but when I updated after putting pw I go to log in to it it’s not letting me? I’m 3/4 way thru any suggestions?