I migrated almost all my stuff from Google, but Photos were still standing. Let's deep dive into this topic and change that!
Welcome to my post about switching from Google Photos to Immich self-hosted software.
Disclaimer: One of harsh truths about this is that you need to know something about linux commands, and it is not that easy to migrate. Having production ready photo app is not only about having the app running, but also about backups and security.
My steps
| Chapter Link | Name | Description |
|---|---|---|
| Chapter 1 | Why Immich and Hetzner | What else could I use? |
| Chapter 2 | Used technologies | Mainly description of Hetzner storage options |
| Chapter 3 | Setting up Hetzner server | How to set up Hetzner server correctly with volumes |
| Chapter 4 | Immich infrastructure | How to set up Immich, showcase of my repository with README |
| Chapter 5 | Immich backup | How to set up backup of photos and database, examples in repo |
| Chapter 6 | Photos migration | How to migrate photos from Google once Immich + backups are up and running |
| Chapter 7 | Price comparison | Google Photos vs my Immich setup price comparison |
| Chapter 8 | Summary | --- |
Why Immich and Hetzner
Immich
Immich is a self-hosted photo and video management solution which is looking similar to Google Photos.
It has great docs, android and iOS apps and a big team working on it.
Many people are self-hosting it, and they are really happy, Immich repository has over 100,000 stars and new versions are coming out regularly.
In case you will use Immich, think about donating some money to them via official webpage
If you don't want to self-host, check out Ente.
Hetzner
For compute hosting, I had multiple options (check them here) but ultimately I liked Hetzner, their location in Germany and that all their datacenters are powered with sustainable power.
You can choose whatever VPS provider you find cool; I would just keep in mind you probably want a provider from EU since you are doing this migration for a reason (buying a server from Google would be weird)
Used technologies
So what we need from Hetzner is:
- Cloud server (different name for VPS)
- I used CX23 with 2 cores and 4 GB RAM, and it works for now, but I would recommend getting CX33 (or CPX31) to be sure (Immich recommends 6 GB of RAM)
- Hetzner Volume for fast photo storage on the server
- Running Immich instance uses this volume to save photos, videos, etc.
- You can scale the size dynamically, I bought 100 GB in the beginning
- Docs page here
- Storage Box for backups
- BX11 in my case for 1 TB of space
- Every night the data (photos and database dump) are copied to this Storage Box
- Docs page here
Another thing you probably want is a custom domain.
- I recommend this since Caddy will get you HTTPS certificates automatically for your Immich address. Plus it looks neat.
- I have my domain with Soverin per my EU mail solution blog post.
Setting up Hetzner server
After you buy a cloud server from Hetzner (let's say CPX31) you will need to set it up. This is outside the scope of this post, but think about:
- Using SSH key to connect (instead of name/password)
- Using firewall and enable only ports 22, 80 and 443
- Setting up SSH brute-force blocker (like
fail2banfor example)
Once you are done, buy Hetzner Volume (Block Storage) in the same location as your server and mount it.
- Hetzner offers auto-mount, docs here
- Your disk will be available at
/mnt/HC_Volume_${VOLUME_ID}, this is the location you will save your photos to (in other words, this is the location you will put into.envconfig for Immich)
As the last step, buy Hetzner Storage Box in a different location than your server
- Different location because this is backup, and you don't want your backup to be in the same datacenter as your server
- You will need to set up SSH key on the server to connect to Storage Box, How-To docs
- Later on we will
rsyncdata nightly to this storage
With these 3 bought you can go to the next chapter and set up Immich
Immich infrastructure
I've prepared a repository immich-infra which helps with the setup.
Note: Always check if this repository was updated with latest Immich version
Checkout the README file, please read it first before you start typing commands
In a nutshell
Steps needed on the server:
- Install Caddy
- Installs caddy reverse proxy logic and gets you a certificate
- Setup Immich with disk storage
- Prepares Immich instance with saving data into Hetzner Volumes SSD
- Set up nightly backups with systemd timers (this is described in the next chapter)
- Every night a script copies the data into Storage Box
Steps needed for custom domain:
- Set DNS A record to point to your server IP address
- This step is not in the README, you need to edit this in your-domain-provider's webpage
example.orgneeds to match yourIMMICH_SITE_HOSTNAMEincaddy.servicefile
DNS A record example:
example.orgpoints to1.12.345.67with TTL5 minutes
After you are done with Immich instalation you can create first admin user, check official docs
Immich backup
As mentioned previously, check immich-infra repository and find Backup Strategy chapter.
Once done your data will be transferred every night into the Hetzner Storage Box
Now your system is running and backing up the data.
Wait for the first automated backup to be done (the next day) and TEST restoring it (either on server or on your local machine). How-to on backup restoration is also in the README
Your backup is useless if you cannot restore it, so please pay attention to this step.
If your backup works, I recommend you to move it to the HDD somewhere disconnected from the internet. Repeat it once a time.
Photos migration
Let's stop here for a quick recap:
- You have your Immich instance up and running on Hetzner
- Your backups are performed regularly
- Your domain and certificates are configured, you can access Immich at
example.orgin your browser - Your admin and users are configured in Immich per official docs
Now is the time to actually migrate your photos from Google. You have many options from which I recommend two:
Option 1 - Manually download from Google Photos
I would use this option if you already have your photos in albums and want to keep them that way.
- Log into Google Photos
- Choose album
- Click download all
- Create album in Immich
- Upload photos to the album in Immich
Pros:
- If you download Google Photos album which is shared, even photos which are not yours will be downloaded (thus you can save them into Immich)
- Neatly organized albums
Cons:
- It takes a lot of time
Option 2 - Download photos via Google Takeout
If you don't care about albums or don't have shared photos albums in Google Photos, feel free to do it an easy way.
- Log into Google Takeout
- Click to download all your Photos only (by default you could download all your data from multiple apps)
- Choose file size, bigger the better (if you click only 2 GB file, and you have 100 GB of photos it means you will need to download and unzip 50 files)
- Once you have all your files (or parts of them) on the disk somewhere drop them into Immich UI and wait for upload
Pros:
- With this approach, albums are also downloaded, but only with your photos
- Fast, almost no work needed
Cons:
- You will need to categorize your photos once uploaded to Immich
- You could be missing some of the shared photos
Price comparison
We will do the calculation for:
- CX33 server - €6.99/month
- 100 GB volume - €4.40/month; €0.044 per GB/month
- 1TB BX11 Storage Box - €3.20/month
Remember: Hetzner Volume is pay per GB, so if you use 500 GB it will be €22/month
All prices are without VAT.
With this setup it costs €14.59/month + VAT.
Important distinction is that on Immich instance, you are able to have multiple users thus lowering price per user significantly. With 3 users you are on ~€5/month which is closer to Google Photos or Ente (Ente has Family Plans with shared storage though).
Google Photos are (depending on country) around €2.50 per 100 GB but keep in mind you should also back it up (this bumps up costs a little bit)
Ente is €5.99 per 200 GB so that's also cheaper than Immich on Hetzner.
Summary
Self-hosting is hard and ofter costly way to software. But if you want extra privacy and really owning your own photos, it's one of the best approaches.
In the end (if you still want to self-host and don't want to pay for Hetzner setup) I would recommend getting your own NAS, removing server and volume costs and using Storage Box as a backup, this would shrink your monthly costs to ~€3.20 (not counting the price of NAS in the beginning)
If you don't want to self-host but want to migrate from Google, use Ente - I was also seriously thinking about it.
Thanks for reading this post, as always feel free to ping me on blog@sivak.eu if you have any questions, or you need help with setting this up.