Running a website or blog on a USB flash drive

Of all the good things we can do with a USB (Universal Serial Bus) flash drive, I think running a website is one of them. This is a perfect solution for web designers who need to cart along a whole bunch of designs to show potential clients.

usb-flash-drive.jpgMost USB drives today carry a large amount of space, and the cost for a 2 Gb drive only sits around $30 these days. You can literally store an infinite amount of data in there without having to worry about lugging along a laptop or cramming your desktop hard drive with more stuff.

There is an open source WAMP (Windows-Apache-MYSQL-PHP) bundle called XAMPP (the X is an acronym for any of 4 operating systems that it can run on) that are able to run most PHP based scripts directly from the bundle’s installation directory.

Just download it as a zip file, and unpack it onto your USB flash drive. In order to run a site, let’s say a WordPress test blog, you need to create a folder with a specific name in the htdocs folder of your XAMPP installation directory.

So, if you named your folder as “testblog” and your flash drive is named as E:\, the path should look like this:

E:\XAMPP\htdocs\testblog

So briefly, the steps to run a WordPress blog on a USB flash drive are just:

  1. Install XAMPP by unpacking it onto the drive.
  2. Click on the icon file named “xampp-control”.
  3. Start Apache and MySQL by clicking “start” for each of them.
  4. Open a browser window and type in http://localhost/xampp
  5. You’ll see a splash screen; click on phpMyAdmin and create a new database with your chosen name by entering it into the empty field and clicking on the “create” button.
  6. Copy all the WordPress files into E:\XAMPP\htdocs\testblog
  7. Edit the wp-config-sample.php as you would for a self hosted WordPress blog. You may use the username of “root”, and no password is needed, because the user “root” has by default, all privileges, and no password.
  8. Go to the url http://localhost/testblog and the rest is history.

In all, it should not take more than 5 minutes, as WordPress states. You can use XAMPP to try and install many other scripts like Joomla, Drupal, Moodle…etc, and work on them in your leisure time, right from your very own “mini server”. Although XAMPP turns your little USB drive into a “mini server”, the only one who can access “localhost” is you.

I don’t know about you, but I think it’s pretty cool to be able to run a website from a tiny USB stick. :)

27 Responses to “Running a website or blog on a USB flash drive”

  1. [...] Modern Street A Blog on and about the Web « Running a website or blog on a USB flash drive [...]

  2. [...] about duplicating or replicating your WordPress blog on a USB flash drive using XAMPP instead of running a fresh WordPress install. Sometimes you may just want to replicate your live blog because you want to test a theme or change [...]

  3. thats frickin insane!

    where my usb keydrive when i need it!

    imagine that – misplacing your server!

  4. wow, that truly is amazing. I remember being impressed enough at being able to launch my own desktop, open office & firefox from a usb stick, but an apache server, php and a blog?!! :)

    wow again.

  5. That may be the single coolest idea I’ve heard all week! Thanks for the info, I’m going to go download XAMPP right now!

  6. hm, very interesting
    ‘ll go download :)

  7. Very cool approach. Considering that a UBS drive would generally outlive a harddrive, I’ll give it a try.

  8. Cool idea. This solution can be use as presentation purpose or even as publication products. for example: USB flash drive with web site inside.

  9. I also like to use my USB drive for other portable applications, like Firefox. It gives you safe and convenient web surfing capabilities from any computer.
    Also, I only paid $9.99 for my 4 GB flash drive from Wal-Mart. So, it was definitely worth the buy.

    frelly said:
    “Very cool approach. Considering that a UBS drive would generally outlive a harddrive, I’ll give it a try.”

    It’s been my experience that USB drives DO NOT outlive hard drives. They are static flash memory devices. And over time, they will fail. I guess it depends on how many times you write / re-write to them that makes the difference.

  10. In response to Affordable Custom Web Design – I have several memory sticks which I carry around with me, one has just applications on it. I have portable versions of Firefox, Avast and even Photoshop and Dreamweaver (I believe this isn’t actually illegal providing you have a legitimate copy!)

    Having all my apps on one drive is very handy, it means I can leave a stick in the car and have access to my favourite apps on any machine whenever I need them!

  11. Thanks for info!

  12. I think this is a great idea. Portable wordpress is a very clever and techie replacement for a journal or diary.

    My one complain is with this statement: “You can literally store an infinite amount of data…”

    Literally you can’t store an infinite amount of data on a 2GB drive. Literally there are actual limits, 2GB.

  13. @Jared
    Thanks. Yeah, but with most USB drives having 8 GB or more these days, a lot of websites can be stored in there ;)

  14. Customizing your localhost to a flash drive is sweet! It adds flavor to web design. I’ve heard of small OS’s running from the USB port but nothing like this… If a MAC address could be assigned to this device then switches could now access your drive.

  15. Oh man, I’ve been playing with WAMPS in my web development for years, and running demos of all the apps I can hack and themes/templates I can customize from a USB stick on any machine is very impressive to clients. Especially when you explain “It’s my own little web-server – runs from the stick and doesn’t install anything on your machine…” I’ve been asked if they could keep it – and why not? It’s a great way for them to practice using the “back-end” of some app you’re customizing for them.

    It’s true the USB sticks are apt to fail after X-number of read/writes (I don’t think anyone really knows), so make sure you back everything up. But that’s as easy as copying the whole XAMPP folder to another drive, and running the little “setup-bat” file to reconfigure the base drive-letter in it’s config path to the new one (or you could do this manually). After that, everything will work exactly the same when you visit “http://localhost/” with your browser.

  16. @ Mark

    Yeah, I love using a flash drive whenever I can :)

  17. useful and greate post thanks

  18. that is a good news for me. i have many blogs and sometimes we need a lot of data due i often do blogging in different place..thanks for sharing this info..

  19. technology these days…

  20. Initially I thought .. cool idea, wow!
    But thinking about it.. ofc you should be able to do it, why didn’t I consider it before, maybe its not that practical but still retains some of the coolness from the idea.

    Will try it out to try, see if I impress some people less tech savvy than me, which is a rare breed indeed.

  21. @ Andy Allsop

    Try it out on a computer without an internet connection, and load a full website up. It’s good for demos if you’re a coder or developer.

  22. Awesome!Much thanks,I’ll have a try.

  23. It won’t be long that web servers will be on mobile devices, once the mobile networks could support massive traffic.

  24. Yeah….this does do some handy things. There are some cons…a flash drive is a little slower than say…a 15k Serial SCSI drive. And of course if have a decent server…you can cache the whole site to memory in just a few seconds. Then you just write your changes…guess it depends on how much traffic you are getting. But for demo for a new web client…can not beat a flash drive. Slap it in PC…show them their potential new site! But for the love off all that is good…BACKUP YOUR FLASH DRIVE! Can not count how many times I have had someone bring me a broken flash drive wanting to get the data off the silly thing.

  25. This cool approach can be made cooler. Create a folder on usb drive. Share that folder with full permissions. Map that folder as R (or some other available letter) drive. Unzip Xmapp zip file into this R drive. Run your web site from within this R drive. Later on suppose you want to run the web site from hard drive. Just copy the usb’s shared folder onto hard drive. Re-map R drive to the hard drive’s folder. By using this sharing and mapping, you can toggle between usb drive and hard drive or whatever.

  26. @ La Fullerton

    Thanks for the extra tips.

  27. Very creative. I’ve never even thought of doing this. I’m going to give this a try. I’ll let you know how it turns out. Thanks!

Leave a Reply