If you’ve imported years of photos into Immich, you’ve probably noticed how quickly your timeline fills with duplicate-looking images. Burst shots, RAW+JPEG pairs, edited versions, and multiple photos taken within seconds of each other can make browsing your photo library unnecessarily cluttered.
That’s exactly why I built immich-smart-stacker—an open-source tool that automatically creates photo stacks in Immich, keeping your timeline clean without requiring hours of manual work.
👉 GitHub repository: https://github.com/myrveln/immich-smart-stacker
Why Automatic Stacking Matters
Immich already supports photo stacks, but deciding which images belong together is still a manual process.
For small libraries this isn’t a problem.
For libraries containing 20,000, 50,000 or even 100,000+ photos, manual stacking simply isn’t realistic.
After migrating my own photo collection, I wanted something that could automatically identify related images while remaining configurable and safe to run repeatedly.
That became immich-smart-stacker..
What Does immich-smart-stacker Do?
immich-smart-stacker connects to your Immich server using the official API and analyses your assets to determine which photos should belong to the same stack.
Instead of relying solely on filenames, it uses configurable matching rules to intelligently group related images.
Depending on your configuration, it can identify:
- Burst photos
- RAW + JPEG pairs
- Edited versions
- Photos captured within a configurable time window
- Images that share common metadata
- Other similar assets based on configurable rules
The result is an Immich timeline that’s significantly easier to browse while still preserving every original photo.
Built for Self-Hosted Automation
One of my primary goals was to make the tool completely hands-off.
Once configured, immich-smart-stacker can run automatically using:
- Docker
- Docker Compose
- Kubernetes CronJobs
- Cron
- Any other scheduler
In my own homelab, it runs on a schedule and automatically processes newly uploaded photos.
After importing new pictures, I don’t need to think about stacking at all.
Safety Comes First
Whenever software modifies a photo library, caution is essential.
immich-smart-stacker includes several features designed to minimise risk:
- Dry-run mode
- Detailed logging
- Configurable matching thresholds
- Conservative default behaviour
- Optional replacement of existing stacks
I highly recommend performing a dry run before enabling write operations, especially when processing an existing library for the first time.
Easy Docker Deployment
Getting started only requires:
- An Immich server
- An Immich API key
- Docker (or another supported runtime)
The repository includes complete examples and configuration documentation, allowing you to get up and running in just a few minutes.
Why I Open Sourced It
Like most of the software I publish, immich-smart-stacker is completely open source.
The project exists because I needed it myself, but I hope it becomes useful for the wider Immich community as well.
If you discover a bug, have an idea for smarter matching algorithms, or want to contribute improvements, you’re very welcome to open an issue or submit a pull request.
Community feedback is always appreciated.
Future Improvements
There are plenty of ideas for future development, including:
- Additional matching algorithms
- Smarter duplicate detection
- More metadata-based grouping
- Performance improvements for very large libraries
- Additional configuration options
Suggestions from users will help shape future releases.
Give It a Try
If you’re running Immich as your self-hosted photo management solution, automatic stacking can make a surprisingly big difference to the overall browsing experience.
Instead of scrolling through five nearly identical photos every time you open your timeline, you simply see a single stack representing the moment.
If that sounds useful, check out the project on GitHub:
https://github.com/myrveln/immich-smart-stacker
I’d love to hear how it works with your photo library and what features you’d like to see next.
Frequently Asked Questions
Does Immich automatically create photo stacks?
Immich supports photo stacks, but creating them is generally a manual process. immich-smart-stacker automates the process by analysing your photo library and creating stacks based on configurable matching rules.
Can it stack RAW and JPEG photos?
Yes. One of the common use cases is automatically grouping RAW and JPEG versions of the same photo.
Does it support Docker?
Yes. The recommended deployment method is Docker, although it can also be run anywhere that supports the application.
Is it safe to run on an existing library?
Yes. The application includes a dry-run mode so you can preview all changes before any stacks are created.
Is immich-smart-stacker open source?
Yes. The project is released as open source under its GitHub repository and welcomes community contributions.