A safe place to store photos at home

I’ve been taking photos for years and now have many thousands, in fact too many to store on my laptop. My family take photos too, and we all like to share them.

None of us are particularly happy with Facebook or other online photo sharing sites, and anyway most of these are geared towards individual photographers, not a family of photo sharers.

As I’m a programmer I like to know how things work and strongly favour a solution where I can see and test the photo and metadata storage, so that I know that everything is safe. (And OK, yes, as a programmer I’m much more motivated to create my own solution rather than use an existing one!)

So how do we store and share our photos? Our solution: a Home Photo Bank. It’s a safe place to store and share your family photos on your home network.

If you’ve got a spare computer around, a cheap Raspberry Pi would be idea, then follow this blog post to get your own photo bank up and running.

As well as photo storage and sharing, there are also tagging features so that you can categorise and discover related photos.

../../../_images/home-photo-bank-search.jpg

You can read a bit more about the photo bank on its GitHub page: https://github.com/ericclack/home-photo-bank

Note: this is tested on Raspbian, and Mac OS. It should work on any Debian distro, and will probably work on Windows with some tweaks.

What you need:

  • A Raspberry Pi, model 2 or 3, running Raspbian
  • A router to plug it into, or use wifi
  • Some familiarity with the linux command line.

The steps:

Here’s a summary of the steps we’ll carry out:

  • Make your Raspberry Pi visible on your home network
  • Install packages: oracle-java8-jdk and mongodb
  • Install the application
  • reate cron ‘reboot’ entry to run the photo bank
  • Add a photo-uploader user, SSH keys and local scripts to make it easy to import files
  • Test that it works.

Make your Raspberry Pi visible

Your family and friends (and anyone else on your home network) need to be able to access the photo bank. Set the Pi’s hostname by editing /etc/hostname and then share the link http://photobank.local:3000/ - replace “photobank” with whatever hostname you gave your pi.

Install packages

Use apt-get to install the required packages: Java JDK for the runtime, and MongoDB for the data store and git to get the app itself.

sudo apt-get install oracle-java8-jdk mongodb git

Install the Photo Bank

There are five parts to the install:

  • Install the build tool Leiningen
  • Get the app source code
  • Make media directories
  • Set database credentials
  • Run the app to download dependencies and start up the photo bank

To get Leiningen:

wget https://raw.githubusercontent.com/technomancy/leiningen/2.7.1/bin/lein
chmod +x lein
lein

To get the app source code run:

git clone git@github.com:ericclack/home-photo-bank.git

Make media directories:

The photo bank stores photos in media directories. Create these before you run the app:

cd home-photo-bank/media
mkdir _import _process _failed

Credentials:

The media and database credentials are stored in the file profiles.clj – create this file and add these lines:

{:profiles/dev
  {:env
    {:media-path "media"
     :database-url "mongodb://localhost/photo-bank" }}}

Almost there

Now run the app, this will download all dependencies on the first run:

cd home-photo-bank
lein run

Now you should be able to browse to http://photobank.local:3000/

Pop some files into the folder media/_process and then browse to the Import tab to tag and import.

Further set up information is available on the project GitHub page including scripts to automate start-up, import and backup.