Install Wikipedia Locally - gHacks Tech News

Install Wikipedia Locally

Update: Wikifilter has not been updated since 2006. We suggest you try solutions like Kiwix for Android or Okawix instead.

I mentioned previously that it is possible, and in fact quite easy, to install Wikipedia locally which has several advantages but also one disadvantage.

Advantages should be clear: you do not need an Internet connection to access Wikipedia contents, you can distribute the solution to as many computers as you want and you can make it available in a local area network. Look ups should be faster as everything's already available locally.

The only disadvantage that I can think of is that some articles may have been updated in the meantime which means that you don't get access to those updates until you download the package files again.

The English database file has a size of more than 11 Gigabytes - packed that is - and it can take some time to download it depending on your Internet connection.

I did use a download manager to make sure that the download does not get interrupted and I would have to start over again. Here is the list of files that you do need, I walk you through the installation afterwards:

  • Wikipedia Database Snapshot - the file needed is currently called enwiki-latest-pages-articles.xml.bz2. You may download other files instead, for instance abstracts only.
  • An Apache server. I did use the free XAMPP and installed it on a Windows machine.
  • Wikifilter - the script that makes Wikipedia available on the server.

I suggest you start by downloading the files needed. The Wikipedia database download will naturally take longer than the other two downloads which is excellent for our purpose.

Once XAMPP has been downloaded install it. You are asked if you want to add services to your system during installation, this is not needed. Make sure you start the XAMPP control panel afterwards.

apache server

Keep this open and wait for the downloads to finish. Now unpack the file that contains the Wikipedia articles and wait for it to finish. The unpacked file has a size of more than 13 Gigabytes so make sure you have enough free hard drive space on that drive.
Now add the date of the release in the format YYYYMMDD to the file name. I added it at the end before the .xml.

wiki index

Now run WikiIndex.exe and drag and drop the XML file in the program window. It starts indexing the database file which should take a while as well (5 minutes on my system). We are almost done now.

You need to locate the httpd.conf file in the XAMPP directory and add an entry to it. The file is located in xampp\apache\conf. Just open it with a normal text editor and add the following line at the end:

LoadModule WikiFilter_module "C:/Program Files/WikiFilter/WikiFilter.so"

Please replace the path to the WikiFilter.so file with the path on your system. You should also note that the file path uses "/" instead of the usual "\" to separate directories.

Start Apache using the XAMPP control panel and point your browser to the url http://localhost/wiki/. If everything went well, you should see Wikipedia pop up in your browser of choice.

Summary
Install Wikipedia Locally
Article Name
Install Wikipedia Locally
Description
Find out how to install Wikipedia on a local Windows machine.
Author

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. noneck said on January 6, 2008 at 8:42 pm
    Reply

    For other quick Wiki and CMS Stacks, check out http://www.bitnami.org. These stacks rock. Including full featured WAMP, LAMP, MAMP, and Ruby Stacks that install in a couple of steps!

  2. Bohol said on January 7, 2008 at 2:58 am
    Reply

    Wikipedia is doing too many things and it seems Wiki has a plan to topple Google in the long run.

  3. suraj said on February 12, 2011 at 4:54 pm
    Reply

    after pointing to the WikiFilter.so on my system (in xampp), my apache server does not start. Plz can anyone help?

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.