Run Your Personal Wikipedia from a USB Stick
Posted by Gina Trapani at 4:00 AM on February 12, 2008
![]()
You don't have to lease server space or keep your home computer always on to access a personal web server—you can run a web, FTP, and database server straight from a USB drive. A slim web server package called XAMPP fits on a USB stick and can run database-driven webapps like the software that powers Wikipedia, MediaWiki. Almost two years ago you learned how to set up your "personal Wikipedia" on your home web server to capture ideas and track document revisions in a central knowledge repository. Today we'll set up MediaWiki on your flash drive for access on any Windows PC on the go.
A word on security: The XAMPP web server package is intended for web developers to use while building web sites, so by default, the passwords are blank and configuration is not secure. Running server software opens up a port on your computer, which in and of itself is a security risk. Getting this set up requires getting your hands dirty editing configuration files. If you're not comfortable with the risks and implications of this solution but still want your own wiki, I highly recommend the free, hosted, PBWiki. Also check out the nifty TiddlyWiki for a less setup-intensive wiki-on-a-thumb-drive alternative.
Still with me? Let's get your personal wiki running on a thumb drive.
What You'll Need
In order to get your personal Wikipedia running on your thumb drive, you'll need:
- A Windows XP PC with Service Pack 2 or Windows Vista Ultimate
- A thumb drive with at least 150MB free. The bigger your drive, the more data you can store on it so go as big as you can here.
Install and Start XAMPP
Download the XAMPP Lite .EXE installer from here. Double-click on the file to extract it, and choose your flash drive's drive letter as the destination (not a subfolder.) A folder called xampplite will be created on your thumb drive.
(Note: I chose XAMPP Lite because it offers everything we need to run MediaWiki, and it's smaller in size than XAMPP. But XAMPP is updated more often than XAMPP Lite, and you can install add-ons with full-on XAMPP, so it may be a consideration if you want to do more than just run MediaWiki on your thumb drive.)
Once XAMPPLite is saved to your flash drive, to start it up, double-click on the xampp-control.exe file in the xampplite directory. That will launch XAMPP's Control Panel, which lets you start all the services you need.
To run MediaWiki, you need two services: Apache web server, and the MySql database server. Click the Start button next to each of those in the XAMPP Control Panel, as shown.

When you hit the Start button, your system's firewall may ask whether or not it should allow incoming and outgoing connections to the software. Allow it.
Now your portable web server is up and running. To see it in action, in your web browser, visit http://localhost/. Click on your language of choice—by default, XAMPP Lite's English homepage looks like this.

The first thing we want to do is set up a few passwords to secure your servers. Click on the "Security" link on the sidebar (by default, located at http://localhost/security/. You'll see that by default, all of XAMPP's settings are marked as insecure. Click on the link below the security table to "fix" the problems (by default, http://localhost/security/xamppsecurity.php.) On this next page, set your MySql database password for the root user. If you choose, you can set a password for visiting any web page as well, as shown.

To enable the new MySQL password, switch to the XAMPP Control Panel, stop MySql, and start it again.
Install and Configure MediaWiki
Now that your web and database server is up and running, it's time to install the MediaWiki wiki software. Download the latest version of MediaWiki from here (as of this writing, the file name is mediawiki-1.11.1.tar.gz.) Extract the files (first gunzip, then tar, the free 7-Zip utility can do this for you), and by default they'll be stored in a folder called mediawiki-1.11.1. Rename this folder simply wiki and move it to your thumb drive in XAMPP's xampplite\htdocs\ folder. When you're done, if your thumb drive's letter is G:\, the full path to the MediaWiki files would be G:\xampplite\htdocs\wiki\.
To configure MediaWiki, visit http://localhost/wiki/. Click on the link to configure your wiki. There you can keep all the default settings except:
- You must enter the name of your wiki. Mine is "GinaWiki."
- You must enter a wiki administrator name (by default, WikiSysop) and password.
- Enter your database information. The database name can stay wikidb, but change the DB username to root and enter the password you set up above.
Scroll to the bottom of the page and click on the "Install MediaWiki!" button to save your settings. When the installation is complete, MediaWiki will prompt you to move the LocalSettings.config.php file up a directory on your thumb drive. Go ahead and do that. You're moving the file from
G:\xampplite\htdocs\wiki\config\LocalSettings.php
to
G:\xampplite\htdocs\wiki\LocalSettings.php.
Finally, visit http://localhost/wiki/ to see your fresh new MediaWiki installation in action, as shown below. Congratulations!

From here you can start editing and adding pages, creating user accounts and even uploading files to your new wiki.
But first, two helpful customizations will make your new wiki easier to use.
- Make your wiki the default start page. When you visit your local server, you might want your wiki's home page to appear first instead of XAMPP's homepage. To do that, open the
index.phpfile in XAMPP'shtdocsdirectory in a text editor. Change the line that reads:header('Location: '.$uri.'/xampp/');toheader('Location: '.$uri.'/wiki/');and save it. Now, when you visit http://localhost/, you'll go directly to your wiki. - Add a custom wiki logo. To add your own logo to the upper left hand side of your wiki install, create a 135x135 pixel image, name it
mywikilogo.png, and save it toH:\xampplite\htdocs\wiki\skins\common\imageswhere H: is your thumb drive's letter. Then, open theH:\xampplite\htdocs\wiki\LocalSettings.phpfile in a text editor and add the following line:$wgLogo = "/wiki/skins/common/images/mywikilogo.png";Save the file, and refresh your wiki in the browser. You should now see your custom logo. (Note: the logo doesn't have to be a PNG file; substitute your image's extension, like JPG or GIF.)
Stopping and Starting Your Wiki
When you're finished using your wiki, invoke the XAMPP Control Panel running in your system tray. Click the Stop button next to Apache, then click the Stop button next to MySql. Once the servers have stopped, click the Exit button. You can now eject your thumb drive as usual. Remember: don't try to eject your thumb drive before stopping the services; doing so can blue screen your PC and possibly screw up your wiki and server installation.
To start up your wiki at a new computer, plug in your thumb drive, and double-click on the xampp-control.exe file to start the Control Panel. From there, start the Apache and MySql servers, then visit http://localhost/ to edit your wiki.
Why a personal Wikipedia?
A wiki is an incredible collaborative tool for groups of people, but it's also a great one-stop shop for your own personal "stuff I want to remember"—like ideas, drafts, lists, and bookmarks. If you haven't edited Wikipedia or just want to see what MediaWiki can do, here's a quick demonstration of what writing a novel draft would be like using the software and its special Wikitext markup.
More Portable Web Servers
XAMPP isn't the only portable web server on the block. Another free portable server package called Server2Go includes Perl 5.8. Thanks, Vijay!
What do you do with your key chain web server? Let us know in the comments.
Gina Trapani, the editor of Lifehacker, likes her web servers tiny and portable. Her weekly feature, Geek to Live, appears every Tuesday on Lifehacker AU.
Tags: capture tools | clips | downloads | feature | geek to live | home server | portable | portable applications | thumb drive | thumb drives | top | USB drive | video demonstration | web server | wiki | wikipedia | windows

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
mwschmeer
Posted 5:44 AM 12/2/08
Here's another vote for a TiddlyWiki, albeit from another source:
[www.tiddlywiki.com]
mwschmeer
Adam B.
Posted 5:44 AM 12/2/08
Brilliant!
I've had an idea a little while back about recording all of my memories into electronic format so I can remember and refer back to them in the future. If I get a USB stick with built in encryption, this will be the perfect solution for that!
Adam B.
cakezula
Posted 5:44 AM 12/2/08
just curious; why not a bitnami install?
cakezula
Eclipsor
Posted 5:44 AM 12/2/08
@BishopNeo: It's almost worth it at that point to get a cheap VPS and just host a personal wiki on there (fwiw, I use www.vpsvillage.com). Perhaps you would have to use wiki software that's easier on resources, but it would save hassle once it's all set up.
Eclipsor
MDW
Posted 5:44 AM 12/2/08
Another webserver is WOS (Webserver on a Stick) Apache2, PHP5, MySQL5 and PHPMyAdmin. Plus add packages as you need them, including Media Wiki. Runs off of a USB stick. It's portable, will run on any computer running Windows. Works great easy to install and configure. Check it out. [www.chsoftware.net]
MDW
digitalpincushion
Posted 5:44 AM 12/2/08
If you don't need a full blown wiki (which for personal stuff like notes,drafts, etc I personally don't) you should pull down Tiddlywiki. It is one page and runs in your browser, so it is completely cross platform without the the overhead of Mysql/Apache/etc
Here is the Tiddlywiiki page
You can also host it online (and save and run it locally) at Tiddlyspot which I use all the time as well (especially the MonkeyGTD template).
digitalpincushion
TommySez
Posted 5:44 AM 12/2/08
One thing I've never understood was replacing a quasi-standard, like HTML, with a collection of application-specific wiki-formatting standards.
Is HTML really that hard? (Granted, entities are a pain.)
TommySez
selowitch
Posted 5:44 AM 12/2/08
Or it is possible to do the initial setup using a Mac? I guess I could try using Parallels to emulate WinXP to do that, although I hate it....
selowitch
BishopNeo
Posted 5:44 AM 12/2/08
So here's my question, is it even possible to set something like this up so that it will work no matter what type of system you plu it into? For example I use Windows at work, but Mac at home and I'd love to be able to port this back and forth without major refactoring each time I plug it in.
BishopNeo
EmilyMamasBloggin
Posted 5:44 AM 12/2/08
I have wordpress.org installed on my stick, as well as a copy of the most recent backup of my online db.
EmilyMamasBloggin
Hieronymus
Posted 6:48 AM 12/2/08
Exactly - just go with Tiddlywiki and you don't need no stinkin' web server/database/php. Completely browser based and works on any OS.
Hieronymus
jeffeb3
Posted 6:48 AM 12/2/08
What about a Linux version? Don't leave me hangin'!
jeffeb3
fuzzymuffins
Posted 6:48 AM 12/2/08
don't really need a wiki, but a good tip on XAMPP. i needed a good simple local server/php/mySQL for development that doesn't run on my HD. works great!
fuzzymuffins
pab10h
Posted 7:49 AM 12/2/08
If you look at XAMPP's web page you'll see that they have Linux (mature) and Mac (beta) versions; with a little tweaking (or just tripling the space used on the USB stick) it should be fairly easy to set this up so as to create a multiplatform local web server with your PHP/Perl/Python applications of choice and your data stored in MySQL...
pab10h
AceKicker
Posted 7:49 AM 12/2/08
I'm not very fluent with the workings of Wiki's, as I've never had to author one before. This article sounds like a great idea, but for what I'm thinking I'm not sure if it's quite what I need.
In a sort of combination of this and the "Idea Incubator" article, as well as an information database I wanted to be able to integrate random thoughts or ideas that could pertain to any number of applications.
So I think what I'd need is something that combines (or can modified to combine) the backbone of a Wiki with the ability to add and search by metatags like you'd find on WordPress or blog aggrigators. Anyone have any ideas?
AceKicker
Delzhand
Posted 7:49 AM 12/2/08
I agree with DigitalPincushion. Tiddlywiki is nice because it's a single file, no installation, no nothing. Toss it on a flash drive and there you go. I've been using it for months. To create new entries, just doubleclick on any word, plus you can display any number of entries at once.
Delzhand
dimo414
Posted 9:05 AM 12/2/08
Check out Uniform Server ([www.uniformserver.com]) it's a fantastic little webserver, smaller than XAMPP, and much easier to set up.
dimo414
nightbirdsf
Posted 9:05 AM 12/2/08
If this is just between your computer and your USB flash drive via localhost (127.0.0.1), AFAIK there should be no need to punch a hole in the firewall for the Wiki. Also, why does the flavor of Vista have to be Ultimate?
nightbirdsf
thunder7
Posted 9:05 AM 12/2/08
I have to say GinaGenius Just awesome.
I will have to get my webmaster on that when she has time, Finally be able I hope to get my massive collection of bookmarks / favorites online.
And you know Gina You are genius.
:-)
thunder7
wolfsong
Posted 9:05 AM 12/2/08
Yet another vote for TiddlyWiki. I use it on my work laptop (XP), home desktop (XP) and my personal laptop (Ubuntu). I use it as a journal, idea incubator, knowledgebase, etc.
It has an easy setup and once you get the hang of installing plugins it is just as easy to maintain.
wolfsong
T.G
Posted 10:20 AM 12/2/08
If this is a double post I apologize... there is an alternative controller for XAMPP that can be used on removable drives. It is available at [www.zedfiles.com] There is also information on 'alternative porting' to avoid conflicts with existing installations.
T.G
T.G
Posted 10:20 AM 12/2/08
There is an alternative controller developed in collaboration with XAMPP (DTX-Launcher)that is available at www.zedfiles.com which will make it easier to run XAMPP on a USB stick.
T.G
KrofDrakula
Posted 10:20 AM 12/2/08
+1 for dimo414's comment - I'm using one on my laptop and is highly portable and secure (unlike XAMPP default, it has a virtual drive that confines the Apache processes to that drive). Also, you can just take it out and simply put it on a stick and share it, just as easily as you would XAMPP (and others alike).
KrofDrakula
Nepherim
Posted 12:38 PM 12/2/08
Throw in for PmWiki. Everything in flat files so no DB to install or backup; runs on any webserver that can dea; with PHP, or simply use the standalone single-EXE mini-webserver. No restrictions on the amount of data, as you'll eventually hit with TiddlyWiki.
Nepherim
dbr
Posted 1:44 PM 12/2/08
Running the server on a port over 1024 will mean you don't need to be an admin to start it.
But really, with all the non-server-side wikis, this seems a bit overkill.
As for a cross-platform version of this - it'd be trivial to set a web-server (thttpd/lighttpd/apache etc) to run within a folder on a USB drive, and a .command file or little application to launch it. MySQL might be slightly more complicated - A wiki based of SQLite would make it much simpler..
dbr
newworldsamurai
Posted 6:58 AM 13/2/08
I didn't like TiddlyWiki. But a similar one that I do use is Wiki on a Stick: [stickwiki.sourceforge.net]
it's a self modifying XHTML file that doesn't require the overhead of a webserver or database and is completely cross platform. all you need is the file and a browser.
Its just a matter of preference, but Wiki on a Stick felt more like the familiar wiki to me than TiddlyWiki did.
newworldsamurai
mzucker
Posted 4:27 PM 16/2/08
If you like TiddlyWiki, you might also like to look at WikidPad. (See [wikidpad.python-hosting.com] and [www.jhorman.org])
WikidPad is written in Python and is designed for use as a personal desktop wiki. It works on both Windows and Linux (and probably Mac, but I'm not sure). If you know a little CSS you can customize the preview display to suite your tastes.
mzucker
Travis Anderson
Posted 3:22 AM 17/2/08
sorry for the double-post, but I just wanted to point out the WOS Portable option in contrast to the Uniform Server option: [www.mediawiki.org]
Travis Anderson
Travis Anderson
Posted 3:22 AM 17/2/08
MediaWiki actually has its own suggestion for running on a stick: [www.mediawiki.org]
Travis Anderson
MrBil
Posted 6:28 AM 19/2/08
Goood timing...I was having trouble setting up a first wiki on my VPS. I accidentally ran across this article a couple days ago and did not stop until I had it running on my USB stick. Now a couple days later I am still learning the ins and outs of configuring the wiki but am impressed with your article. With other sites like PortableApps.com this will be a very portable solution.
An awsome site...awful distracting though with all the cool info!! :)
MrBil
Koli
Posted 5:04 AM 23/2/08
If you have added information to MediaWiki, or to Tiddlywiki, then decide to change to a different Wiki, how easy is it to export the information and import it into the new Wiki?
Koli
Nalco
Posted 5:41 AM 3/3/08
I know this article is a few weeks old, but I just wanted to say thank you for this info. I wanted to run my own local wiki, and also my own local copy of wordpress. I work on WP themes quite a bit, and running my own server makes thing much easier. No more having to FTP all my files after each edit.
Thanks!!!
Nalco
jayw
Posted 10:23 AM 20/3/08
This is great! I have my personal wiki up and running, and it's fun messing with. Should I want to make this a live-on-the-web wiki, what would I need to do?
I know I'd have to install mediawiki, no big deal there, but after that, is there a simple way to make the database I work on on my wiki-on-a-stick to the web version?
Thanks!
jayw
Henrik Aasted Sørensen
Posted 10:23 AM 20/3/08
If you are looking for portability across platforms, I can recommend the setup Jetty [www.mortbay.org] and JAMWiki [jamwiki.org]
Jetty is a light-weight, Java web-server. JAMWiki is Java-port of MediaWiki, that ships with an internal database.
The installation can pretty much be narrowed down to the following:
1. Download Jetty and JAMWiki.
2. Unzip Jetty.
3. Unzip the JAMWiki war file into the webapps directory of jetty.
4. Start Jetty ("java -jar start.jar").
5. Go to localhost:8080/jamwiki.
This setup has provided me with a "wiki on a stick" that runs fine on both Windows and my Mac OS X.
To ensure that my Wiki will not be available to strangers if I lose my USB, I have the entire setup on a TrueCrypt [truecrypt.org] volume.
Henrik Aasted Sørensen