This article explains how and why you should install WordPress on your computer.
An offline version of WordPress is one where WordPress is installed locally on your computer. In order to do this you need to turn your computer into a local server. Once that is done you can then install WordPress on your home computer. Before I get into how to do this I want to briefly go through the three main advantages for installing WordPress locally on your computer.
The first and biggest advantage is that you are not working on a live website. This means you can install plugins, customize your themes and do virtually anything else to your site confident in the knowledge that if it goes wrong there is no impact on your live website.
The second advantage is it speeds up your website development. It is always faster to work on the local server than on your web host’s servers. This is because you will experience a bit of latency when you work directly with your web host’s servers.
Finally the third advantage is that you can take your WordPress backups and see if they are working by testing them out in your local installation of WordPress.
To turn your computer into a local server requires Apache, MySQL, and PHP. Installing these server programs separately can be tricky but fortunately for us there are two free programs that will install and manage all this for us. For Windows computers there is XAMPP and for the Mac there is MAMP. Although XAMPP can work on a Mac MAMP is more stable on it.
I use XAMPP on a Windows 7 computer so that is the program I will use for this tutorial.
In order to install WordPress on your computer five steps need to be taken.
1. Install a local server:
- Download the latest version of XAMPP from apachefriends.org/en/xampp.html
- During the installation tick the box to create an XAMPP desktop icon and do not change the default installation folder which will be the root of your hard drive (C: xampp).
2. Create a new database and User:
To create a new database complete the following steps:
- Open up the XAMPP Control Panel through the XAMPP desktop shortcut.
- Start the Apache and MySQL services.
- Open your browser and type in the address bar “localhost / phpmyadmin /” (without the quotes).
- In phpMyAdmin type in a database name and click the “Create” button.
- Write the database name somewhere because we’ll be using it later on.
You now need to create a user for the database by doing the following:
- While still in phpMyAdmin click on the “Privileges” tab then click on “Add a new User”.
- Enter information in the “User name” and “Password” fields. For Host select “Local”.
- Write the User name and password somewhere because we’ll be using them later on.
- In “Global Privileges” click on “Check All” then click the “Go” button on the bottom.
- In “Database-specific privileges”, in the “Add privileges on the following database” field, select the database name you previously created.
3. Download WordPress:
- Download the latest version of WordPress from wordpress.org/download/
- Extract the WordPress zip file you downloaded to C: xampp htdocs
4. Configure WordPress with your MySQL database information:
Go to C: xampp htdocs wordpress
Open up wp-config-sample.php with a text editor and edit the following area with the database details from step 2:
/ ** The name of the database for WordPress * /
define (‘DB_NAME’, ‘wordpress_db’);
/ ** MySQL database username * /
define (‘DB_USER’, ‘wordpress_user’);
/ ** MySQL database password * /
define (‘DB_PASSWORD’, ‘typeyourpasswordhere’);
Once the editing is finished save the file as wp-config.php in the same folder.
5. Install WordPress:
To complete the installation of WordPress make sure that the Apache and MySQL services are still running then open up your browser and type in the address bar:
localhost / wordpress / wp-admin / install.php
This will start the WordPress installation process.
Following the instructions and filling in the fields should not take more than five minutes.
After completing this you should now have WordPress installed on your computer.
Just remember that whenever you want to run WordPress you have to make sure that you start the Apache and MySQL services. The services can be started and stopped from the XAMPP Control Panel desktop shortcut.