Host Your WordPress Blog Locally

Host Your WordPress Blog Locally

If you regularly tweek your blog’s design, layout or test plugins – I would recommend having a local version of your blog.


Hosting locally means running a duplicate copy of your live blog on your local machine. In other words, your PC becomes your web and database server.
Having your own development area is a bit like having your own playground, with freedom to test and tweek as you please without affecting the live system. Web developers generally adopt this approach before deploying.

Hosting your blog locally is a very straight forward process, and would require the following;

  • Installing a web server on your computer.
  • Creating a database.
  • Downloading the latest version of wordpress.

There are several ways to achieve this, but one the easiest ways is using a tool called XAMPP, which happens to work across most operating systems.

Step 1

Install a local web server

PC

This is quite straight forward on a PC, simply visit http://www.apachefriends.org/en/xampp-windows.html to download and install XAMMP Lite executable file.

Linux

For Linux users, applying a few commands in your terminal should get you up and running. Simply visit http://www.apachefriends.org/en/xampp-linux.html for download and install instructions.

MAC

MAC users, download and extract XAMPP file from here http://www.apachefriends.org/en/xampp-macosx.html

Step 2

Create and active your database
Using the downloaded XAMPP tool, you can create a new database for your local blog. Simply open XAMPP control panel and select the Admin button next to MySQL. This should then take you phpMyAdmin page.

On this page, under MySQL Localhost section, you can create a new database name.

At this stage, to make sure everything is working fine, start the Apache and MySQL services, it will notify you once it starts.
You should also see the XAMPP splash screen when you type “localhost” into your browser.

Step 3

Download and Extract WordPress
You can download the latest version of WordPress by visiting wordpress.com Once downloaded, extract the zipped file and move it inside the htdoc folder. On a windows machine, this can be located under c:\xampp\htdoc

Step 4

Update your wp-config.php file
In this file, you will have to define your database parameters to enable connection.
In your wordpress folder, c:\xampp\htdoc\wordpress\

  1. Rename the file wp-config-sample.php to wp-config.php
  2. Define your database name – (‘DB_NAME’, ‘test‘);
  3. Define your database username – (‘DB_USER’, ‘root‘);
  4. Define your database password – (‘DB_PASSWORD’, ‘test‘);

You can find your database information from the phpMyAdmin page, located under the MySQL section

Step 5 and final step

Configure and Install
Run install.php file by pointing your browser to http://localhost/wordpress/wp-admin/install.php and hit enter.

  1. At this stage, you then see the configuration file, complete the fields with the same information as your wp-config.php file.
  2. Complete your blog title along with your email address and hit Run install
  3. ALL DONE – You now have a copy locally.

To transfer files from server to local machine, I would recommend using a an FTP client such as FileZilla.

What are your thoughts on testing locally?


About the Author

John Lufadeju

  • http://jimijones.com/ Jimi Jones

    Hey, John.
    This is a really nice tutorial you've put together and a great way to do some tinkering without affecting your live site, as you've pointed out.
    Well done, my friend!

  • http://jimijones.com/ Jimi Jones

    Hey, John.
    This is a really nice tutorial you've put together and a great way to do some tinkering without affecting your live site, as you've pointed out.
    Well done, my friend!

  • http://yourblogtools.com/ Johnluffa

    Many thanks Jimi

  • http://www.yourblogtools.com/ John Lufadeju

    Many thanks Jimi

  • http://www.mikeslife.org Mike CJ

    I don't use WP, but I can easily translate those elements to Drupal. Really useful post John. I've always wanted to understand how to do this.

  • http://www.mikeslife.org Mike CJ

    I don't use WP, but I can easily translate those elements to Drupal. Really useful post John. I've always wanted to understand how to do this.

  • http://www.mikeslife.org Mike CJ

    I don't use WP, but I can easily translate those elements to Drupal. Really useful post John. I've always wanted to understand how to do this.

  • http://www.FromLPNtoRN.com/ Earl Hardaway

    Very helpful. Going to try this out this weekend as I try to learn how to mess with Headway.

  • http://www.FromLPNtoRN.com/ Earl Hardaway

    Very helpful. Going to try this out this weekend as I try to learn how to mess with Headway.

  • http://yourblogtools.com/ Johnluffa

    Hey Mike, I'm glad you found it helpful.
    We really must get you over to WordPress someday :-)

  • http://www.yourblogtools.com/ John Lufadeju

    Hey Mike, I'm glad you found it helpful.
    We really must get you over to WordPress someday :-)

  • http://yourblogtools.com/ Johnluffa

    Hello Earl, Good to see you.
    I've heard some good stuff about Headway, hope you have fun learning it.
    Thanks

  • http://www.yourblogtools.com/ John Lufadeju

    Hello Earl, Good to see you.
    I've heard some good stuff about Headway, hope you have fun learning it.
    Thanks

  • http://ileane.wordpress.com ileane

    Hi John, I didn't know this could be done. I didn't think most people had that much space available on their own pc's. Thanks for the info, these instructions seem easy to follow.

    @Ileane

  • http://ileane.wordpress.com ileane

    Hi John, I didn't know this could be done. I didn't think most people had that much space available on their own pc's. Thanks for the info, these instructions seem easy to follow.

    @Ileane

  • http://web2andmore.net Kevin Tea

    I wish I had this when I started last July! I am planning a second blog and this will be great for getting everything just right before releasing it into the wild. Last time round it was trial and error and the first month or so was a nightmare as I tweaked bits and pieces.

  • http://web2andmore.net Kevin Tea

    I wish I had this when I started last July! I am planning a second blog and this will be great for getting everything just right before releasing it into the wild. Last time round it was trial and error and the first month or so was a nightmare as I tweaked bits and pieces.

  • http://www.sigmasquared.co.za/ Ross Saunders

    I use a slightly different twist on this and use a “staging” environment in a subdomain of my blog, learnt many lessons from working in IT…

  • http://www.sigmasquared.co.za/ Ross Saunders

    I use a slightly different twist on this and use a “staging” environment in a subdomain of my blog, learnt many lessons from working in IT…

  • http://www.sigmasquared.co.za/ Ross Saunders

    I use a slightly different twist on this and use a “staging” environment in a subdomain of my blog, learnt many lessons from working in IT…

  • http://www.integralwebsolutions.co.za/Blog.aspx Robert Bravery

    great resource John. WordPress is such a widely used application, that resources like this will come in handy to many.

    While I do use Linux most of my work is done on Windows. Now nobody scream.
    WordPress is also available for Windows, using PHP and Mysql. But the instalation is slightly different.

    Now you can install WordPress on Vista/Windows 7 with either Apache server or IIS7.0.

    So for all those Windows and WP fans, (SOrry John, hope I am not hijacking your comments here), I have written a nice little tutorial on how to install and get WP working on Vista/Windows1 and IIS7
    Using WordPress on Vista and IIS 7.0
    I think that article will be of benefit to your readers, especially those who are using Windows and seek to use WP as well.

  • http://www.integralwebsolutions.co.za/Blog.aspx Robert Bravery

    great resource John. WordPress is such a widely used application, that resources like this will come in handy to many.

    While I do use Linux most of my work is done on Windows. Now nobody scream.
    WordPress is also available for Windows, using PHP and mySQL. But the installation is slightly different.

    Now you can install WordPress on Vista/Windows 7 with either Apache server or IIS7.0.

    So for all those Windows and WP fans, (Sorry John, hope I am not hijacking your comments here), I have written a nice little tutorial on how to install and get WP working on Vista/Windows7 and IIS7
    Using WordPress on Vista and IIS 7.0
    I think that article will be of benefit to your readers, especially those who are using Windows and seek to use WP as well.

  • Pingback: sigma.squared » Blog Archive » DIY Webserver from Scratch

  • http://yourblogtools.com/ Johnluffa

    Yep, it can be done, a local area doesn't necessarily use up as much resources as you would think.
    You can pick and choose what data you wish to copy over to your local machine.

    Thanks Ileane

  • http://www.yourblogtools.com/ John Lufadeju

    Yep, it can be done, a local area doesn't necessarily use up as much resources as you would think.
    You can pick and choose what data you wish to copy over to your local machine.

    Thanks Ileane

  • http://yourblogtools.com/ Johnluffa

    Releasing to the wild???
    Is that what you think of the blogosphere? LOL :-)
    I had similar trial and error experience in my early months too.
    I tried everything out, I even managed to take down the site a few times too.
    Thanks Kevin

  • http://www.yourblogtools.com/ John Lufadeju

    Releasing to the wild???
    Is that what you think of the blogosphere? LOL :-)
    I had similar trial and error experience in my early months too.
    I tried everything out, I even managed to take down the site a few times too.
    Thanks Kevin

  • http://yourblogtools.com/ Johnluffa

    Hi Ross,

    I'm familiar with that working approach too.
    It's actually not a bad idea sticking a “staging” environment on a sub-domain.
    Thanks for that Ross :-)

  • http://www.yourblogtools.com/ John Lufadeju

    Hi Ross,

    I'm familiar with that working approach too.
    It's actually not a bad idea sticking a “staging” environment on a sub-domain.
    Thanks for that Ross :-)

  • http://yourblogtools.com/ Johnluffa

    Hey fellow Linux user :-)
    Totally my pleasure, I'm always up for learning new things, especially techniques that would streamline the process.
    In the case of Windows, an activated IIS would make this even easier and convenient, since it comes built in.
    Although on XP, I am aware that IIS isn't available to XP Home edition users. Is there similar restrictions on Vista/Windows 7?
    Again, there are so many ways to approach this. Personally, I prefer the command-line approach on Linux.

    XAMPP seems to be a nice all-rounder.

    Will check out your post on this – Many Thanks Robert

  • http://www.yourblogtools.com/ John Lufadeju

    Hey fellow Linux user :-)
    Totally my pleasure, I'm always up for learning new things, especially techniques that would streamline the process.
    In the case of Windows, an activated IIS would make this even easier and convenient, since it comes built in.
    Although on XP, I am aware that IIS isn't available to XP Home edition users. Is there similar restrictions on Vista/Windows 7?
    Again, there are so many ways to approach this. Personally, I prefer the command-line approach on Linux.

    XAMPP seems to be a nice all-rounder.

    Will check out your post on this – Many Thanks Robert

  • http://www.sigmasquared.co.za/ Ross Saunders

    You seem to have inspired a few posts today, John! Currently working on one of my own regarding configuring your own linux web server… Will drop a tweet when its done!

  • http://www.sigmasquared.co.za/ Ross Saunders

    You seem to have inspired a few posts today, John! Currently working on one of my own regarding configuring your own linux web server… Will drop a tweet when its done!

  • http://yourblogtools.com/ Johnluffa

    That's fantastic Ross, I look forward to reading it – Tweet me when you're done.

  • http://www.yourblogtools.com/ John Lufadeju

    That's fantastic Ross, I look forward to reading it – Tweet me when you're done.

  • http://zemalf.com/ Antti Kokkonen

    Great guide John! Using XAMPP and running a local WordPress is really easy (with informative guide like this) and great way to test new design and plugins for WordPress.

  • http://zemalf.com/ Antti Kokkonen

    Great guide John! Using XAMPP and running a local WordPress is really easy (with informative guide like this) and great way to test new design and plugins for WordPress.

  • http://yourblogtools.com/ Johnluffa

    Many Thanks Antti, :-)
    XAMPP makes it very easy and straight forward.

  • http://www.yourblogtools.com/ John Lufadeju

    Many Thanks Antti, :-)
    XAMPP makes it very easy and straight forward.

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://ericasays.com EricaMueller

    Ah, my husband does this. I have yet to try it out. You're inspiring me!

  • http://www.air-jordan-17.com air jordan 17

    It looks good,I have learn a recruit!
    Recently,I found an excellent online store, the
    sall4.net are completely various, good quality and cheap price,it’s worth buying!

  • http://www.nikemaxsale.com air max shoes

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum!friednoodle

  • http://www.moncler-jackets-outlet.com moncler men

    A closely taste of various characteristic snack. Experience the excitement of tasty and spicy, relax and enjoy the fresh of delicious.Here's sites presen various clothing fit for couple dating, friends dinner and banquet.<a href=” http://www.see-for.com“ >see for

  • http://www.discount-nike-dunk-shoes.com nike dunk

    Hhe article's content rich variety which make us move for our mood after reading this article. surprise, here you will find what you want! Recently, I found some wedsites which commodity is colorful of fashion.
    http://www.inin-from.com

  • http://www.uggs-outlet-store.com UGG boots

    I am also a XX fan who really like this! I also like XX, and purchase lots of it every time,
    <a href=” http://www.always11.net“ >always11
    like-minded friends can have a look ,we can communicate by the way~~

  • Become a Fan


    Your Blog Tools on Facebook
  • Build Your Team

  • Article Marketing Tool

    Submit a different unique article to hundreds of sites