A

Install WordPress locally offline on your computer

Alright! This tutorial is not the first one but I just installed a local copy of WordPress on my desktop so that I can design my own theme and use WordPress more as a CMS rather than being blog-centric script. I thought of posting this tutorial so that I can direct help on local installations […]

Alright! This tutorial is not the first one but I just installed a local copy of WordPress on my desktop so that I can design my own theme and use WordPress more as a CMS rather than being blog-centric script. I thought of posting this tutorial so that I can direct help on local installations to this article. If you have ever installed WordPress manually, then its exactly the same procedure but if you have only tried with One-click installations, then this is new for you. Without any further delay, here is what you need to do.

  • Install XAMPP on your computer. (Download XAMPP)
  • Now Start Apache & MySql from XAMPP and type localhost in your browser.

start-service-mysql-apache

  • Select phpMyAdmin from the left and create a new database.

create-database-phpmyadmin

  • Download the lastest copy of WordPress available from WordPress.org
  • Unzip the compressed file of WordPress under the htdocs folder of XAMPP folder (By default it is installed in C:\XAMPP\)
  • Rename the wp-config-sample.php to wp-config.php and open it any editor for editing. (I use Notepad++ Portable)
  • Come back to the wp-config.php file and fill your database name (the name you chose while creating the database), username (root) and leave the password entry as blank.
    It should look like this (I chose wordpress as my database name):
    define('DB_NAME', 'wordpress');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    When you have filled in your Sql settings, then save the file and exit the editor.
  • Now open localhost/wordpress in your browser. Fill in the details and click Install WordPress.
  • Copy your randomly generated password and login into your WordPress dashboard. Remember to change the password to something that you can remember easily.
  • That’s it. Just open localhost/wordpress/ in your browser and it will point to the local copy of WordPress installation.

I am all open for help. Have your say in the comments.

23 responses to “Install WordPress locally offline on your computer”

  1. John says:

    Thanks for the information.

  2. Kuruvi says:

    very interesting. Thanks for sharing.. Let me try this!!! 😀

  3. panji says:

    hi, i’m new in wordpress,
    thanks for your sharing, but i have problem, when i typed localhost/wordpress
    the browser told me :

    Object not found!

    The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

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

    Error 404

    localhost
    07/08/09 00:28:08
    Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

    . thank you,

    (i’m sorry about my english 😉 )

    • Ashfame says:

      @panji
      That will work if you have a folder named wordpress under your htdocs folder. Like if you have a folder named wp under your htdocs folder, then enter localhost/wp in your browser.

  4. Patrick says:

    I’ve done everything as indicated and still this will not work.

  5. I want to try this because I need to do some work and won’t have access to the internet, but my question is — how do I transfer the files and database to the appropriate domain once I want to go live with it.

    Thanks so much for your help!

  6. Ashfame says:

    @Patrick
    Please elaborate your problem.
    @Erica
    I guess just restoring the local database to the live Mysql server will do but if it didn’t then you can use the export and import feature of WordPress.

  7. thanks for your reply! I actually was never able to get it set up it kept getting hung up when I hit start mysql – not sure what I was doing wrong

  8. Ashfame says:

    @Erica
    Don’t know what is the cause of the problem. Running them services may cause issue, also try running them normally.
    Other than this you can also try reinstalling XAMPP or install any other web server software.
    Hope that helps.

  9. Wes says:

    Followed the directions and everything seems to work. Everything in the admin site works great. However, when I test out my website and click on a link, the link is broken and I get the following error:

    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.
    Error 404

    • Ashfame says:

      @Wes
      Probably you have hardcoded links in your template. When you encounter the error page, check the address bar and you will realize that URL don’t exist on localhost. Hope that helps 🙂

    • Mateusz says:

      For all you who are trying to get it done, I guess it is an .htaccess issue – if you change your Permalinks you also need to update your .htaccess file – if you won’t than your pages are impossible to be found. Your .htaccess should contain the folowing :

      RewriteEngine On
      RewriteBase /wordpress/
      RewriteRule ^index\.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /wordpress/index.php [L]

      It helped me with the issue that you are describing.
      Hope that is what you need.
      Good luck and keep it up!!

      • Ashfame says:

        Since the tutorial is windows based, I wonder what could interfere with creation of a file as there are no permissions issue.

  10. Tom says:

    Hi, Thanks for the tutorial. its just what i need.
    Unfortunatly i have run into a number of errors. When i go to localhost/wordpress i get this message:

    “Deprecated: Assigning the return value of new by reference is deprecated in C:\xampplite\htdocs\wordpress\wp-settings.php on line 520

    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampplite\htdocs\wordpress\wp-settings.php on line 535

    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampplite\htdocs\wordpress\wp-settings.php on line 542

    Deprecated: Assigning the return value of new by reference is deprecated in C:\xampplite\htdocs\wordpress\wp-settings.php on line 578

    Deprecated: Function set_magic_quotes_runtime() is deprecated in C:\xampplite\htdocs\wordpress\wp-settings.php on line 18

    Warning: Cannot modify header information – headers already sent by (output started at C:\xampplite\htdocs\wordpress\wp-settings.php:520) in C:\xampplite\htdocs\wordpress\wp-includes\pluggable.php on line 850”

    Can tell me why this would be happening?

    Kind regards
    Tom Connelly

  11. vrunda says:

    thanx for the information… it’s helpful.. may i know after working offline how to upload it?

    • Ashfame says:

      upload whole site?
      Just move the database up and link to a new set of WordPress files uploaded and link to the db you just uploaded and then edit the wp_options table in database to reflect the changed URLs

  12. mikeymushi says:

    Wow thank you for the tutorial,it helps alot,one request, can you give a step to step detail of how you deploy it on the internet onceyour done on the localhost,im hosting on Go Daddy.

    • Ashfame says:

      Post content or themes?
      You can just upload theme and they should work fine if you coded them the right way and regarding content, the database should reflect the new URL in the options table.
      Right now busy with my schedule so can’t write a full post about it.

      • mikeymushi says:

        Moving the whole site as it is on the local-host ,but im in no hurry,so when you find the time can you do a topic on that becaise its a little more tricky than just uploading all the content.Good day and thanks for the quick feedback

      • mikeymushi says:

        Moving the whole site as it is on the local-host ,but im in no hurry,so when you find the time can you do a topic on that because its a little more tricky than just uploading all the content.Good day and thanks for the quick feedback

  13. Martin says:

    Thanks for the advice. I have been sratching my head over how to do this simply, my plan is to do local, controlled builds of my wordpress for editing and content creation offline then commit to my site once everyhting is in order. This means i can work offline at any point now and commit the changes later! Brilliant. Now if I could find away to comit only ‘changes’ to save on badwidth that would be amazing. Anyone got any ideas?

  14. sol says:

    tnx so much! I did it! still have a lot to learn..tnx again!

  15. Paige Cuccaro says:

    Thax for the info! I wanted to use WordPress to design a site offline. I got the XAMPP installed, and installed latest version of WP but after activating the Twenty Eleven theme that came with it, it still acts like WP.com and new pages are like separate blog posts with comment secetion in stead of standard webpages. Any idea what I’m doing wrong?