
I’ve been working with WordPress offline for very practical purposes. It lets me try out themes without having to consume bandwidth on my web host. I just use it whenever I’m trying out my meager skills with PHP, MySQL, and WordPress. I haven’t really thought of letting others know how I do it until a web designer friend of mine asked me to help her out on how to run WordPress locally without having online server access. So here I am making a hasty how-to on the matter.
The first time I tried it, it really ran smoothly that I don’t know if it’d work for all. So I have to place a little disclaimer here that, while it worked for me, I’m not guaranteeing that it’d work 100% smoothly for you too (since we have different machines, apps installed and configurations). But here’s what I did.
Download XAMPP
Of all the apps that installs the Apache web server, MySQL and PHP, XAMPP has proven to be the easiest to install for me. If you ask me, it really takes a genius to manually install Apache, MySQL and PHP on your machine and make them work flawlessly.
Since I’m no certified MENSA member, I tried XAMPP. I downloaded this one with the installer package. And lo and behold, it’s almost a one-step installation for me.
NOTE: This was done on an Intel-based PC with Windows XP.
Install XAMPP
NOTE: Installation processes may vary depending on your machine (Mac or Linux) so better check the XAMPP website for other details. Mac users may find more on installing XAMPP here.
With the Windows installer package, the XAMPP installation process is easy. The most work I did for this one to set the installation path. I set mine to one of my workspace drives. I didn’t check the boxes asking me if I’d like to run components as services. I don’t know if that would affect this process, but just to be sure, leave them unchecked.

Run XAMPP Control Panel
Just start Apache and MySQL. Once you get the green lights on both, you’re ready to go.

Reconfigure your MySQL user details
Now that XAMPP (with Apache server and MySQL) is running, your machine is now also acting as a localhost. And yup, that’s right, that means that you can now access the localhost through your web browser. Accessing http://localhost/ via the address bar will bring you too XAMPP’s interface. It acts pretty much like your host’s cPanel.

Now the first thing to do is to modify XAMPP’s security settings by clicking on security. It’s better to be safe than sorry. You can change your passwords to the MySQL power user and XAMPP directory access on this page http://localhost/security/xamppsecurity.php.

NOTE: Just in case you keep forgetting your security settings (usernames and passwords), you can check the “Safe plain password in text file?” box so you can access them in your folder. But as XAMPP indicates, it’s a security risk.
Create database for WordPress
Now that you’ve configured the security settings, you can now create a MySQL database for WordPress through the PHPMyAdmin interface. Just access it via the XAMPP sidebar and create a new database. In my case, I named it wordpress.

Download and unzip WordPress
Now get the WordPress engine from WordPress.org. Unzip WordPress in htdocs folder in your XAMPP’s installation path. The htdocs folder serves like your public_html in your web host server. Think of Windows Explorer as your FTP in this case.
Modify the wp-config-sample.php
Open the wp-config-sample.php in the WordPress directory with a text editor (or whatever editor you may have). You only need to modify three lines here, the DB_NAME, DB_USER, and DB_PASSWORD which are wordpress, root, and test, respectively in my case. Save it as wp-config.php.

Install WordPress
Now if you followed this process, go to http://localhost/wordpress/wp-admin/install.php in your web browser to go through the WordPress installation process which would just be a few clicks. Your blog will be at http://localhost/wordpress/.
Post Script
So there you go, I hope this little tutorial helps. I’d appreciate some comments and feedback. It worked for me, so I hope it’d work for you too.
50 Responses
benj
May 17th, 2007 at 5:25 am
1I’ll try this it out….
when I stop being lazy about installation Gaaaah. Kakatamad. haha. Cant it be done with one click?! Damn you WP!!! lol
Alex
May 17th, 2007 at 6:22 am
2It’s a lot easier way to try out plug-ins and themes without wasting bandwidth in your web host account.
Sean
June 18th, 2007 at 6:55 am
3This might come across as a stupid-ish question, but once you’ve tested Wordpress using a localhost, is there anything special that you have to do before you can transfer Wordpress from local host to web host?
Although I am pretty good on mark-up, I’m new to bloging and server-side languages.
I’d really appreciate any advice.
Alex
June 18th, 2007 at 7:49 am
4Yes. You might have to export your MySQL database from localhost and import it in your webhost. You also have to upload your WordPress installation to your webhost.
Harmony
June 18th, 2007 at 8:19 am
5Thanks so much for this short and sweet tutorial! I was expecting having to install Wordpress locally to be a headache, but since I already had XAMPP up and running your tutorial was perfect!
Thanks again
Harmony
Paul Escobar
June 22nd, 2007 at 5:53 am
6Hi, thanks for the excellent tutorial!
(Capitals used to emphasize, not to shout)
HOWEVER, if I install XAMPP and WordPress…
WILL OTHERS HAVE ACCESS TO MY COMPUTER?
WILL OTHERS HAVE ACCESS TO MY TEST-BLOG?
I DO NOT want others to have access to the blog I’m editing.
I DO NOT want them to have access to my computer.
Thanks for any reply!
Alex
June 22nd, 2007 at 6:59 am
7No, since it just makes your computer act like a server but things are accessed and stored locally.
The WordPress dashboard, however, would try to access the WordPress site and Technorati to try to get the usual dashboard information.
In any case, just like with any computer, use a firewall, anti-spyware, and antivirus everytime you connect to the Internet.
azilaka
July 24th, 2007 at 7:49 am
8That was really easy! Thank you!!
Doughboy
July 28th, 2007 at 10:26 am
9You need to check out EasyPHP – So much better. I tried Xampp but didn’t like the way it worked. EasyPHP so much better.
robert tayag
August 31st, 2007 at 12:35 am
10i always read your blog,its a nice thing to have here.visit mine also http://ihomejobs.blogspot.com
abdel hamid
August 31st, 2007 at 2:28 pm
11excellent tutorial… except i’m using APPSERV instead
DREW
September 7th, 2007 at 10:08 am
12hi!!!!!!!!
lee dae hee im drew xu i wnt 2 congrast u to you korean drama
Borislav Borissov
September 9th, 2007 at 7:04 am
13Excellent tutorial! Thanks a lot!
African Boy
September 29th, 2007 at 4:23 pm
14[quote]Yes. You might have to export your MySQL database from localhost and import it in your webhost. You also have to upload your WordPress installation to your webhost.[/quote]
I have never seen this to work. Wordpress saves the site address in the database: http://localhost/wordpress. And I am sure your website is not http://localhost.
I copying, I usually do a Find and Replace before dumping in phpMyAdmin’s SQL window.
9jasite.com
Relequestual
October 21st, 2007 at 11:11 am
15Thanks very much for this tutorial. It worked like a charm. I do however think you should add in the fact that it would be a good idea to close down skype. I had to go to the XAMPP website to find out why it wouldnt load. many users would just dismiss it as not working properly.
i shall be posting a link to this once my blog is up and running under its own host steam!
Kind regards
rel
Emma Middlebrook
October 28th, 2007 at 7:56 am
16Thanks for the informative and helpful tutorial. Without it I wouldn’t have known where to start.
Worked a treat
Emma
Robert @ reason4smile
January 27th, 2008 at 6:01 am
17Thanks for putting the guide here, it’s really easy to follow.
Appreciate it very much!
Robert
Adonis
February 25th, 2008 at 2:26 pm
18Thanks, works a treat!
Barbara
March 13th, 2008 at 2:51 pm
19You made my day! Your directions were elegantly simple and worked with installation on a Mac. The only part that I haven’t resolved is the security section, which didn’t work on the Mac.
That required me to change the text editing for the DB_PASSWORD. Since I couldn’t access the security page, I left the password blank. It worked. I’ll write back if I figure out the security section.
Many thanks for sharing your work.
The Construct by Alex Maximo - Commentaries on social media discourse » Blog Archive » Give me Prozac
March 26th, 2008 at 6:33 am
20[...] just finished this tutorial for LifeSpy and I’m having problems following up on it. It’s only 7 AM and I should be [...]
WordPress 2.5 is Out
March 29th, 2008 at 4:36 pm
21[...] 2.5 codenamed Brecker is now available for download. As of now, I’m trying it our with my offline WordPress installation test site before I fully deploy it for my websites. But if what the release notes really deliver [...]
Hatch Media - Web Design
April 30th, 2008 at 2:33 pm
22Wondered if anyone could shine some light on my predicament..!
I’ve installed xampp on my machine and it runs all my test sites perfectly and i’ve opened up my firewall port 80 and it can be viewed externally no problem… Until i install wordpress on my server. What happens is i install wordpress perfectly and it runs a treat from my machine on localhost.. Yet externally none of the php pages will execute, i just get a page cannot be displayed error message, yet i know the files are there????????
Bizarre and no one seems to have an answer!
todd
May 24th, 2008 at 6:02 pm
23Thanks! Worked like a charm
Numerous
June 22nd, 2008 at 4:50 pm
24Thanks this worked perfectly. Also I installed all the XAMPP applications as services (since I wanted to load at bootup) and have had no issues. Also as mentioned before Skype or any application that is using the designated web server, SQL, or FTP ports must be disabled otherwise you will not be able to install the XAMPP applications. Again thanks a million.
Tony
June 23rd, 2008 at 11:43 am
25Thanks for this tip. I need something like this instead of messing up my real blog and getting my readers disappointed. Cheers
David Bell
June 25th, 2008 at 7:15 am
26Thanks for writing this up. I’m about to do a presentation on blogging and needed a backup in case the internet connection went down!!
Much appreciated.
la broma | Bloguear offline desde prisión
June 27th, 2008 at 2:53 am
27[...] buscado y he encontrado esto: http://www.lifespy.com/2007/how-to-install-wordpress-offline/ http://immike.net/blog/2007/06/04/wordpress-plugin-wp-offline/ [...]
Tom
June 28th, 2008 at 5:54 pm
28It works pretty fine for me. Thank you!
Alex
July 12th, 2008 at 11:29 pm
29I have a question I keep getting stuck on Reconfigure your MySQL user details step I keep getting that one page to be displayed like in dutch instead of english for some reason. Also I dont get the page xamp for Windows all I get is the list of files I have under the htdocs.
Pete Blake
August 26th, 2008 at 5:04 pm
30You must get comments like this all the time from ‘newbies’ like me. I run WindowsXP Professional and I know IIS is there somewhere and I can’t get Apache running because of IIS. If you have time, could you advise how I can get round this please? Many thanks.
Peter Blake
Geener
September 23rd, 2008 at 10:21 am
31Hallo everyone i just finished to install wordpress offline, but how to upload my wordpress to server wordpress.com..? Can I do that….?
Thank’s
charlette
September 28th, 2008 at 12:38 am
32Thanks for that! Successfully done – extremely useful!
Ted
September 28th, 2008 at 1:18 pm
33Hi there, I use LAMPP, but I’m troubleshooting a wampp installation for a friend. Is there more output of this error message ‘unable to connect to database’ in windows? Thanks
Alex
September 29th, 2008 at 3:14 pm
34That seems to be the problem with MySQL. Check if it has installed properly together with the rest of XAMPP. Or check the php file that creates access to the database, make sure that the MySQL user and password are in order and that the server is ‘localhost’
eddy
November 12th, 2008 at 7:55 pm
35Hi,
Thanks for the tutorial. I’ve attempted the install on 2 different machines. My Vista laptop was smooth. However Wordpress refused to install on my XP machine. The following error “Apache HTTP Server has encountered a problem and needs to close. We are sory for the inconvenience.”
Any ideas why this is happening?
Cheers,
eddy
Halzyon
February 14th, 2009 at 11:39 am
36Rarely does one find a tutorial that ‘just works’. This one does. And it does it without tossing in a bunch of unrelated techie stuff which only serves to muddy the waters and make the author sound important. Working good is better than sounding good any day.
Thanks a lot – appreciated.
John
February 16th, 2009 at 2:06 pm
37I’d like to add my thanks
you made that installation look very simple
and that’s hard to do
at last I can see what I’m doing before going public
much appreciated
John
Amol
February 27th, 2009 at 9:25 am
38Sincere Thanks !!!
Neil@PS3
February 27th, 2009 at 1:07 pm
39This is great. I have been looking for something that would allow me this functionality. I suppose it is ok to use all the plugins with it also??
***dani***
March 6th, 2009 at 5:15 pm
40Hi, thanks for your tutorials!
I need to transfer my website from one hosting to another, and this guide is very very useful to try to have all files before doing the job.
But I’ve a question.
If I go to localhost/index.php I see my “local” copy of my site, but If I try to navigate I’m redirect to web site, not onto local one. Where did I make a mistake?
I’m sue the site I see is on localhost beacuse I throw away all the plugins I installed… but now?
Thank you very much!
Danilo
Andy
March 9th, 2009 at 9:28 am
41Hahaha this is EXACTLY what I did when my parents grounded me from internet for a month =D
Alex
March 9th, 2009 at 4:30 pm
42Hi Dani, try checking your permalinks if you’ve changed them to your online version’s settings. You might have to modify (uncomment) apache’s mod_rewrite though.
ambaro
March 18th, 2009 at 7:53 pm
43Thank you so much!
I did it. all by myself. and with your help of course
Yeah!
angrezy
March 28th, 2009 at 1:06 am
44Thanks for the valuable post, its done and working sucessfully.
Sam
April 9th, 2009 at 9:41 pm
45I’m running XAMPP on Vista 32 and it’s not functioning properly – every time I try to click on ’security’ as mentioned in this guide I get ‘Access Forbidden’. Therefore I have no idea how to configure my MYSQL settings for Wordpress … any ideas?
John Blink
April 27th, 2009 at 8:38 pm
46I just came by this tutorial and thank you. I don’t know if it has been answered yet but this is for Sam #45.
On the XAMPP website it has the following info.
“Vista Note: Because missing or insufficient write permissions in the c:\program files folder of the default vista installation, we recommend to use alternate folders for XAMPP e.g. c:\xampp or c:\myfolder\xampp.”
Reference = http://www.apachefriends.org/en/xampp-windows.html
If you have a second hard drive you could also install it on D: or E:\xampp depending on the drive letter of that spare HDD.
Hope that helps.
AmandaLP
May 5th, 2009 at 5:40 am
47This is awesome! Thank you so much, this is very helpful.
Chels
May 19th, 2009 at 2:04 am
48Okay so i got all the way to the last step and i can’t install wordpress. Some how i managed to figure out that maybe i have installed it already? in which case how do i uninstall? or find the password they gave me.
also when i access the page http://localhost/wordpress/wp-admin/install.php it says the object is not found. Help?
I’m really excited to start using this… but as i have no experience in this field… i need some help. Thanks!
Brandon
June 5th, 2009 at 12:33 am
49when i access the page http://localhost/wordpress/wp-admin/install.php
I get this error. ( I am running vista)
define(’DB_NAME’, ‘wordpress’); // The name of the database define(’DB_USER’, ‘root’); // Your MySQL username define(’DB_PASSWORD’, ”); // …and password define(’DB_HOST’, ‘localhost’); // 99% chance you won’t need to change this value
Fatal error: Call to undefined function is_admin() in C:\xampplite\htdocs\wordpress\wp-admin\includes\comment.php on line 159
please help
How to Make a Duplicate Copy of Your Wordpress Blog Offline | Earn Money Online with Cajammed
June 22nd, 2009 at 5:21 am
50[...] like to give credit where credit is due. Special thanks to David Tan of Davidtan.org and Alex from Lifespy.com for their equally informative tutorials on this subject though I felt the need to combine both [...]
RSS feed for comments on this post · TrackBack URI
Leave a reply
Categories
Recent Posts
Links
© BloggyNetwork 2007 - All rights reserved.