LifeSpy

Lifestyle Blog!

RSS 2.0

How to Install WordPress Offline

WordPress Logo

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.

XAMPP Installer

Run XAMPP Control Panel

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

XAMPP Control Panel

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.

XAMPP Index

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.

XAMPP Security Settings

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 /security 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.

PHPMyAdmin Create Database

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.

WordPress Configuration

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.

OFF
LifeSpy

92 Responses to “How to Install WordPress Offline”

  • benj says:

    I’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 says:

    It’s a lot easier way to try out plug-ins and themes without wasting bandwidth in your web host account. :D

  • Sean says:

    This 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 says:

    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.

  • Harmony says:

    Thanks 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 says:

    Hi, 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 says:

    No, 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 says:

    That was really easy! Thank you!!

  • Doughboy says:

    You 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 says:

    i always read your blog,its a nice thing to have here.visit mine also http://ihomejobs.blogspot.com

  • abdel hamid says:

    excellent tutorial… except i’m using APPSERV instead :)

  • DREW says:

    hi!!!!!!!!

    lee dae hee im drew xu i wnt 2 congrast u to you korean drama

  • Excellent tutorial! Thanks a lot!

  • African Boy says:

    [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 says:

    Thanks 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

  • Thanks for the informative and helpful tutorial. Without it I wouldn’t have known where to start.

    Worked a treat :)

    Emma

  • Thanks for putting the guide here, it’s really easy to follow.
    Appreciate it very much!
    Robert

  • Adonis says:

    Thanks, works a treat!

  • Barbara says:

    You 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.

  • Wondered 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 says:

    Thanks! Worked like a charm :)

  • Numerous says:

    Thanks 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 says:

    Thanks for this tip. I need something like this instead of messing up my real blog and getting my readers disappointed. Cheers

  • David Bell says:

    Thanks 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.

  • Tom says:

    It works pretty fine for me. Thank you!

  • Alex says:

    I 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 says:

    You 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 says:

    Hallo 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 says:

    Thanks for that! Successfully done – extremely useful!

  • Ted says:

    Hi 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 says:

    That 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 says:

    Hi,
    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 says:

    Rarely 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 says:

    I’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 says:

    Sincere Thanks !!!

  • Neil@PS3 says:

    This 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*** says:

    Hi, 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 says:

    Hahaha this is EXACTLY what I did when my parents grounded me from internet for a month =D

  • Alex says:

    Hi 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 says:

    Thank you so much!
    I did it. all by myself. and with your help of course
    Yeah!

  • angrezy says:

    Thanks for the valuable post, its done and working sucessfully.

  • Sam says:

    I’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 says:

    I 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:myfolderxampp.”

    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 says:

    This is awesome! Thank you so much, this is very helpful.

  • Chels says:

    Okay 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 says:

    when 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:xampplitehtdocswordpresswp-adminincludescomment.php on line 159

    please help

  • Okky says:

    Many thanks!!

  • Charlette says:

    Hi Alex, great tutorial, thanks!!

    I’ve gone almost all the way, but now my http://localhost/wordpress/ is just showing the files in C:xampphtdocswordpress. I’m not quite sure where I’ve gone wrong, as I can access http://localhost/wordpress/wp-admin/ fine and edit things, but when I click ‘visit site’ from the dashboard I just get a list of files and folders.

    Any thoughts? I’ve installed this successfully on my old computer, but I can’t figure out what I’ve done wrong on this one…

    Thanks!
    Charlette

  • Vivek Naik says:

    Really like this tutorial, followed it step by step , was simple and was setup with wordpress within 15 min!

    thankyou

  • Greg says:

    Thanks for the great post. I am getting stuck where I need to create the database. When I go into phpMyAdmin, I am prompted for a username and password. I enter the one I set up in the security step but that doesn’t work. What username and password am I supposed to use?

    Thanks

  • Greg says:

    Update: the error when I try log in is ‘Cannot log in to the MySQL server’
    Can anyone give some advice…..

    Thanks

  • Mel says:

    I get

    “error establishing database connection” when I try to go to http://localhost/wordpress/wp-admin/install.php

    Any ideas where I might have gone wrong?

    I’m using vista

  • Mary says:

    I’ve got everything installed, but can’t login to wordpress on localhost. I’ve tried using the root password, but it’s not found. ???

  • pturner says:

    Thanks! Great directions – works perfectly!

  • Iveta says:

    thankx … something I was just looking for … simple explained … works perfectly … as a new bike :-)

  • Berrold says:

    Awesome
    This worked perfectly and I have no experience of anything like this. Thank-you :)

  • bell says:

    how to find wordpress password in the offline folder has i total forgot mine

  • venkat says:

    Great post,
    followed it and installed wp on localhost
    thx a mill
    Venkat

  • eye says:

    Perfect Tutorial, everyone just follow as is told, and make sure that all the paths are correct for the folders. This is a very easy and excellent tutorial, makes so much more sense to work offline before uploading.

    Cheers mate

  • oldesigner says:

    This was exactly what I was looking for. The reason I need it is to learn the template system without ruining my public site. Thanks a lot!

  • Alukhowa says:

    THANK-YOU!
    Very detailed,

    now downloading xampp-win32-1.7.3.exe

    I wish it will work on ‘windows 7′

    I HAVE ONE QUESTION
    before uploading witch files need to change?

  • Ben Hook says:

    Mate you are a ledgend! If you do a post about how to transfer it onto the online site let me know. Cheers for your help!

  • matteo says:

    very helpful … perfect explanation.
    thanks a lot
    matteo

  • nomi says:

    Love ya buddy , i like you, you don’t know how you solve my problem , first i was fucked through mysql,then apache server, then when both works , i was done, i wanna send you lot of hugsssssssssssssss for free . Thanks a lot buddy , long live,

  • PlantViolence says:

    Thanks. This is exactly what I was looking for.

    Much love. <3

  • Suraj says:

    Can I install this in windows 7?

  • Stacy says:

    Thank you SO SO SO SO much, this worked like a charm – I don’t even know half of the terminology here and I was still able to do it – this was FABULOUS!!

  • Kate says:

    This was extremely helpful. Thank you so much.

  • Ursula says:

    Thank you so much for this tutorial, it helped me a lot. I had some trouble trying to make Apache to run, but then a just turned Skype off and it worked. :)

    I don’t even know half of the terminology here and I was still able to do it [2]

    Cheers!

  • Fiona says:

    Thank you for this blog. It really helped me get through it alot quicker.

  • Atif says:

    Thanks. I was trying easyPHP which claims integrated support for wordpress but didn’t work. With XAMPP it worked at first try. Thank you very much for this helpful post

  • Will Haley says:

    I love you so much for posting this.
    You’re my hero.

  • Spencer says:

    Thank you so much for putting this together as I am presenting a new wordpress site at a conference that doesn’t have internet access. You saved my back end.

  • kelly says:

    Thank you so much!!!!!! It took me ages, but I am there now. Thanks!

  • Mike says:

    If anyone ever has trouble connecting with http://localhost/ then just use http://127.0.0.1/

    Took me ages to figure this out!

  • rontdu says:

    yeap…good things.
    But after http://localhost/wordpress/ i find perfect wordpress,i install new theme , plugins , but face a little limitation.
    that is : when i click a link like : any Latest News link ,then its just show a msg :

    “”
    Object not found!

    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

    If you think this is a server error, please contact the webmaster.
    “”

    how can i use all links in offline ?
    NB: i use Xampp.

    Please help me on my email address.

  • 800 says:

    no go
    this is why *nix mentality is a fail

  • Fred Tracy says:

    This is great. I’ve used this many times and it works perfectly. Right now I’m trying out new themes for my site so I don’t want to change everything online when people are accessing it. Thanks again.

  • Cape Verde says:

    @800
    Sorry I do not understand! Do you mean the permissions thing, because that is the only drawback I have found when using lamp.

  • tq. I could use some info on this page.
    I’m planning on installing wordpress from the start.

  • itsu says:

    Thanks for the great instruction.

    I ran into the ‘Object not found’ error preventing the WP installaion. Through google I found this to be rather common. After some intensive rechecking it turned out my problem was landing the WP installation into C:xamppSECURITYhtdocs instead of C:xampphtdocs. Readlly stupid mistake, but probably easy to make and overlook afterwards, so I post it.

    Thanks again, once I got the directory right, it was a truly enjoyable installation process.

  • number8pie says:

    Thank you so much for that!

    I had spent a good ammount of time in work yeserday hitting my head against a brick wall, trying to install wordpress ofline so I can integrate wordpress to a webste I’m developing.
    The rage was setting in, until this morning when I discovered your post.

    10 out of 10 for a no-fuss straight to the point tutorial.

    Please keep writing this kind of thing,

    Regards,

    number8pie.

  • Fee says:

    Thanks so much for this easy-to-read, easy-to-follow tutorial for a person who is new to wordpress.

    All done and working on my Windows 7 pc within half an hour!

    Thanks so much – it is much appreciated!

    As number8pie wrote, 10 out of 10 :)

  • Steve says:

    Thanks for a great tutorial. I had a few glitches that seemed to be because Win7 kept trying to “protect me.” Running firefox under Windows 7 64 bit and I got the dreaded “phpmyadmim cannot start session with out errors” message. Clearing my browsing history and cache fixed the problem. Also, in order to dive deeper into xammp and php, I could not find php.ini until I went into windows explorer | Organize | Folder and Search Options | View and then checked show hidden files (and, for good measure I unchecked hide extensions for known file types). YMMV.

  • Alex says:

    @Steve: Yup. Win 7 64-bit can give you headaches. I even recommend using the ZIP release for the latest XAMPP rather than the installer version.

  • wktor says:

    Thanks for this tutorial! Thumbs up for putting this together!

    Does anyone have something on exporting the ready site to online hosting service?

  • fitzy says:

    Great work mate…folloew your clear instructions….worked!
    Thank you!

  • yudsky says:

    it’s worked dude!! thanks a lot!!
    just be ensure to use XAMPP that compatible with your OS. I use XAMPP 1.7.2 and frustated at first time because the service won’t worked. After I change the XAMPP compatibility to win XP SP 2 it work smoothly :)
    *now I want to download the win 7 64 ver


best price per inhaler Cheap meds online on this store