Friday, July 24, 2009

Hosting your own photo gallery

If you're a serious shutterbug you probably know about Flickr, Picassa, and SmugMug. Here's another option: you can host your gallery on your own server for free! There are numerous programs you can use to accomplish this and I've tried a lot of them (oh yes there are a lot!), but I never found one that was quite right for me. I wanted something simple with an easy interface that would automatically process my pictures and store any descriptions I added inside the original jpeg file, so I wouldn't lose them if I switch to another program later.

Being a software pro I decided to write my own program. Late in 2006 I began working on my program and soon published my "Ben's Picture Gallery" project on Sourceforge (later moved to GitHub). I realize the name isn't very creative but it's hard to choose a good one. I worked on it through 2007 and then moved on to other projects. This year I finally came back to this project and gave it a modern web standards-compliant upgrade. Thanks to jQuery it got a lot of cool interface features. It also plays much higher quality videos with h.264/mp4.

I have over 16,000 photos that occupy 46 Gigabytes of hard disk space. My collection is growing at a rate of about 10 Gigabytes per year, and I expect this rate will more than double if I buy a video camera. That's a lot of photos! At this rate I'm likely to stay well over the free quota limits of the popular sites like Flikr so I'll probably keep hosting my own pictures for a while.

It's actually not that difficult to host this on your own stay at home server so your friends and family can view them anytime. You need to run a web server and install your photo gallery software (on a Mac it is as easy as turning on "Web Sharing" in the System Preferences). You also need to get a dynamic DNS name from a service like DynDNS. Finally you'll need to open up port 80 on your router to let visitors access your web site. That's it!