Dom Harrington

Replacing Google Photos with PhotoPrism


I've used Google Photos for the last 5/6 years - it is a very convenient way of freeing up space on my device, whilst also providing an off-site backup and very useful searching, sorting and filtering features. However, it is too good to be true, and as the old adage goes “if you're not paying for the product, you are the product”. So in a vague attempt of degoogling certain parts of my life (some other parts are very much a work-in-progress), and with a lot more free time than usual (I'm on parental leave!) I decided to do something about it and look for self-hosted alternatives.

As I mentioned before, Google Photos isn't just a gallery application, it also provides:

  • remote (and off-site) backups
  • web application to view from any device
  • “smart” searching and face detection
  • partner sharing (automatically sharing photos with another person if someone is present)

I was hoping that any open source software I could find would satisfy most (if not all) of the above requirements.

Enter PhotoPrism

I'm actually not sure how I first found out about PhotoPrism, but after various searches and comparison blog posts it kept popping up. From their docs site:

PhotoPrism® is a privately hosted app for browsing, organizing, and sharing your photo collection. It makes use of the latest technologies to tag and find pictures automatically without getting in your way.

PhotoPrism preview image

This sounded perfect! Not only that but they have docs on running it from a Raspberry Pi (which I have sat around doing nothing) and also docs for migrating away from Google Photos. This seemed great! Not only does it meet most of my requirements, it's also open source and under very active development by a small team based out of Germany.

You can view a demo hosted instance here: https://demo.photoprism.org.

Here are the steps that I went through to migrate all of my photos from Google to PhotoPrism:

1. Export your photos from Google

Google helpfully provides a way for you to export your photos in the form of multiple zip files, through their Takeout product. You can specify the file type as well as size of each file. I found .zip and 10GB per file to be the most reliable, but YMMV depending on the size of your archive (mine is ~160GB) and your internet speed.

Image of Google Takeout showing configuration options

2. Combine the zip files together

The zips that you get all seem to have the same folder structure, but with varying amounts of photos and metadata files within them. I began to piece them together manually before getting frustrated. Searching around a bit I found ditto which worked perfectly and did exactly what I needed:

ditto -x -k takeout-20210826T143747Z-*.zip ~/Pictures

This copies the files and folders from inside of the archives and moves them all to subfolders under the Pictures directory in $HOME.

3. Run PhotoPrism and point it at your pictures

PhotoPrism has very good installation instructions and Docker Compose files, so getting it up and running is fairly painless. You can read more instructions here but essentially you just do this:

mkdir photoprism && cd photoprism
wget https://dl.photoprism.org/docker/docker-compose.yml
docker-compose up -d

This will fetch the required containers and run locally on port 2342: http://localhost:2342/

The docker compose file by default looks inside ~/Pictures, but just incase your pictures are anywhere else you can modify the compose file to point to another volume:

volumes:
  - '~/some-other-location:/photoprism/originals'

3. Index your photos in PhotoPrism

Now this is a step that can take some time, and is completely dependent on the specs of your computer. You need PhotoPrism to index your photo collection, add it to their database, classify the images, identify faces and generate thumbnails. You can manually trigger this process by running the following command:

docker-compose exec photoprism photoprism index

This will print fairly helpful log statements, and if you have the application open in your browser then you'll be able to see the images coming in as it processes them! If you leave it to do it's thing, eventually your collection will be imported.


Is this a suitable replacement for Google Photos?

Looking back at the list of requirements from earlier, we can see that it does a pretty good job:

1. Remote (and off-site) backups ✅

PhotoPrism has a built in webdav server, so I've installed an application on my phone (PhotoSync) to automatically import new photos every night. Then I've got Syncthing running on the Raspberry Pi to keep that folder synced up to my main computer.

2. Web application to view from any device ✅

PhotoPrism does not have a native app yet, but what they do have is a PWA that not only works well on desktop, but can be installed to your home screen on mobile - I think this experience is slightly better on Android than iOS, but I'm not too sure.

3. “smart” searching and Face detection ✅

PhotoPrism uses TensorFlow for image classification, which can be hit or miss and is definitely not as good as Google's. Since I've been playing around with PhotoPrism they shipped face detection: https://github.com/photoprism/photoprism/issues/22. While it is a little rough around the edges UX-wise, it's improving all of the time and it is really nice to see the development happening in the open.

4. Partner sharing (automatically sharing photos with another person if someone is present) ❌

This is not something that is possible to do today, though multi-user instances are also in very active development: https://github.com/photoprism/photoprism/issues/98. I hope they add something like partner sharing to automatically share photos across the accounts.


To conclude, PhotoPrism is a very promising open source alternative to Google Photos. Based on what I've seen so far I'm extremely excited about the future of it. Is it as polished and feature complete as Google Photos? No, but is it good enough for me as a privacy-focused replacement? Yes certainly! I really hope there is a future for self hosting and making this sort of thing easier to do for the layman.