How to Install Immich Photo Backup
Install Immich with Docker to replace Google Photos: official Compose files, storage layout, mobile backup, machine learning, hardware acceleration, backups and upgrade safety.
What you'll build
Immich is a self-hosted photo and video solution with slick mobile apps, automatic phone backup, face recognition and fast search. It's the closest open-source experience to Google Photos, but your memories stay on your own hardware.
Immich is a young, fast-moving project. It is excellent, but treat it as "your library's front end", not as your only copy: your photos are irreplaceable, so the backup plan below matters more than the install.
Before you start
- Storage: budget for your whole library plus growth. Photos and videos add up fast — many families need hundreds of gigabytes to several terabytes. Use our storage planner.
- RAM/CPU: machine-learning features (smart search, face detection) benefit from a few GB of RAM and, ideally, a modern CPU or GPU. 4 GB is a practical minimum for the whole stack; 8 GB or more is comfortable.
- Disk layout: keep the PostgreSQL database on a fast local SSD, not on a network share, because the database does not work reliably over NFS or SMB. The photo originals can live on larger, slower drives.
- A backup plan: Immich is your library, not a backup of it. You still need offsite copies. See the backup strategy guide.
Step 1: Get the official Compose files
Immich publishes a maintained Compose file and env file. Create a folder and fetch them:
mkdir immich && cd immich
wget -O compose.yaml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.envAlways use the files from the release you are installing, and read the project's installation page, because the configuration changes between versions.
Step 2: Configure the environment
Edit .env and set at least:
UPLOAD_LOCATION=/mnt/photos/immich # where originals are stored
DB_DATA_LOCATION=./postgres # database files; keep on a local SSD
DB_PASSWORD=change-me-strong
TZ=Europe/Paris
IMMICH_VERSION=v1 # pin a version you have read the notes forPoint UPLOAD_LOCATION at the drive or NAS mount with room to grow. The stack includes the Immich server, a machine-learning container, PostgreSQL and a Redis-compatible cache. Use a strong, unique database password. Pinning IMMICH_VERSION avoids surprise upgrades (see below).
Step 3: Start Immich
docker compose up -d
docker compose logs -f immich-serverWhen it settles, open http://your-server-ip:2283 and create the admin account (the first user is the admin). Then create normal user accounts for family members rather than sharing one login.
Step 4: Set up the mobile apps
Install Immich from the App Store / Play Store. Point it at your server URL and log in, then enable Backup:
- Choose which albums to back up (Camera roll at minimum).
- Enable background backup, and Wi-Fi only if you want to save mobile data.
- Run the first sync on Wi-Fi with the phone plugged in; a large library can take hours.
Your phone now auto-uploads new photos to your server. To use the app away from home, connect through a VPN or a reverse proxy with HTTPS, as described in the secure remote access guide.
Step 5: Enable the good stuff
- Machine learning: face recognition and smart search run in the ML container. On a modest CPU this is fine for a personal library; large libraries benefit from hardware acceleration (Intel, NVIDIA or others, using the project's acceleration configuration).
- External libraries: point Immich at existing folders of photos (read-only) so it can index your archive without re-uploading.
- Sharing: create shared albums, and links with an expiry date, without giving people accounts.
- Storage template: choose a folder structure for originals (for example by year and month) so the files on disk stay human-readable. Decide this before you import a large library.
- Partner sharing and memories: share your whole library with a partner and enjoy "on this day" memories.
Step 6: Storage and backup strategy
This is the part people skip and regret. Immich stores originals in UPLOAD_LOCATION and metadata in PostgreSQL. To protect both:
- Back up the database. Recent Immich versions can create automatic database dumps; confirm the setting in the admin area and that dumps are stored where your backup job will copy them. Otherwise schedule a
pg_dumpfrom the Postgres container. - Back up the upload folder with Restic or another tool to an offsite target.
- Follow the 3-2-1 rule — a local copy plus an offsite copy, with at least one copy that cannot be modified by the server.
- Test a restore on a spare machine at least once.
Use the RAID guide to understand why a mirrored pool is still not a backup, and add a UPS to protect the database from power cuts.
Important: read the release notes
Immich moves fast and occasionally makes breaking changes between versions. Pin a version rather than using a floating tag, and read the release notes before upgrading. Always have a working backup before you update, and update the server and the mobile app together, since they must be compatible.
Troubleshooting
- Uploads fail on large videos — increase your reverse proxy's maximum body size and timeouts.
- ML features slow or crashing — give the ML container more RAM, reduce concurrency in the job settings, or disable smart search on very weak hardware.
- App can't connect — verify the server URL, and use HTTPS via a reverse proxy for remote use.
- Database errors after a power cut — restore from your latest dump; this is why a UPS and backups matter.
- Duplicate photos from an old library — use the duplicate detection tool rather than deleting files by hand.
Next steps
Pair Immich with Nextcloud for documents, and expose both securely through a VPN or reverse proxy rather than opening ports directly. Monitor the stack with Uptime Kuma.
Artículos relacionados
How to Set Up Jellyseerr for Media Requests
Install Jellyseerr with Docker, connect it to Jellyfin, Sonarr and Radarr, and set up users, quotas and approvals so your household can request media on its own.
Cómo montar un servidor multimedia Jellyfin
Instala Jellyfin con Docker y transmite tus películas, series y música gratis a todos tus dispositivos.
Plex vs Jellyfin
Plex vs Jellyfin comparados: funciones, transcodificación por hardware, privacidad, coste y cuál te conviene.