Why Self-Hosting Your Photo Library Makes Sense
Google Photos is convenient until it isn’t. The free unlimited storage is gone, privacy concerns are real, and once your library grows past a certain size, you’re locked into a subscription with no obvious exit. Immich is an open-source, self-hosted photo and video management platform that replicates the Google Photos experience almost feature-for-feature – machine learning face recognition, automatic albums, a mobile app with background backup, and a clean web interface. You run it on your own hardware, and your files never touch a third-party server.
This guide walks through setting up Immich using Docker Compose on a Linux-based home server or VPS. You’ll need Docker and Docker Compose installed, a machine with at least 4GB of RAM (8GB recommended if you want machine learning features active), and enough storage for your photo library. The whole setup takes about 20 minutes.

Creating the Docker Compose File
Immich’s official setup uses Docker Compose with several services running together: the main Immich server, a microservices worker, a machine learning container, a PostgreSQL database, and Redis. The project maintains an official docker-compose.yml and a companion .env file on their GitHub releases page. Rather than building a custom compose file from scratch, the recommended approach is to download those official files directly, which keeps you aligned with upstream updates.
Start by creating a directory for Immich and pulling the official configuration files. Open a terminal and run the following:
mkdir ~/immich-app && cd ~/immich-app wget -O docker-compose.yml 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.env
Open the .env file in a text editor. The two values you must set before doing anything else are UPLOAD_LOCATION and DB_PASSWORD. Set UPLOAD_LOCATION to an absolute path on your host machine where photos will be stored – for example, /mnt/photos/immich or /home/youruser/immich-data. Set DB_PASSWORD to any strong password you choose; this is only used internally between containers. The IMMICH_VERSION field defaults to release, which always pulls the latest stable build, but you can pin it to a specific version number if you prefer more control over upgrades.
One optional but useful setting in the .env file is IMMICH_MACHINE_LEARNING_ENABLED. Machine learning powers face recognition and smart search, but it adds meaningful CPU and RAM load during initial library processing. If your server is low on resources, you can disable the ML container entirely by setting that value to false and commenting out the machine learning service block in the compose file. You can always re-enable it later once your other services are stable.
Starting the Stack and First Login
With the .env file configured, bring the stack up with a single command:
docker compose up -d
Docker will pull all required images – expect this to take several minutes on a fresh install depending on your connection speed. Once all containers are running, Immich’s web interface is available on port 2283 of your server’s local IP address. Navigate to http://YOUR_SERVER_IP:2283 in a browser. On the first load, Immich will prompt you to create an admin account with an email address and password. This is your primary account and the only one with full administrative access.
After logging in, head to Administration > Settings. A few things are worth configuring before you start importing photos. Under Storage Template, you can define how Immich organizes files on disk – by year, month, album name, or a custom pattern. Changing this after import will trigger a reorganization job, so it’s better to decide upfront. Under Thumbnail Generation, you can set the quality and size of preview thumbnails; the defaults are reasonable, but higher-quality settings will consume more disk space over a large library.

The machine learning section in settings controls which models Immich uses for facial recognition and CLIP-based smart search. By default it uses small, fast models that run acceptably on CPU. If you have a machine with a dedicated GPU and want to configure hardware acceleration, Immich supports CUDA for Nvidia cards through a small addition to the compose file – adding a deploy block with GPU resource reservations to the machine learning service. The official documentation covers this path in detail if you need it.
To add existing photos from your server directly into Immich without moving or duplicating files, use the External Libraries feature. Under Administration > External Libraries, you can point Immich at a path already on the host machine and it will index those files in place. This is particularly useful if you have an existing organized folder structure you don’t want to break. Files brought in through external libraries are not managed by Immich’s storage template – they stay exactly where they are.
Setting Up the Mobile App for Automatic Backup
The Immich mobile app is available for both iOS and Android, and it’s the primary reason most people choose Immich over simpler self-hosted gallery tools. Install the app from your platform’s app store, then open it and enter your server URL. If you’re accessing Immich only from inside your home network, the local IP and port (http://192.168.x.x:2283) works fine. For remote access from outside your network, you’ll need to either expose Immich through a reverse proxy with a proper domain and SSL certificate – which you can do with Nginx Proxy Manager – or use a VPN tunnel back to your home network.
Once connected, go to the app’s backup settings and enable background backup. You can choose whether to back up only on Wi-Fi, only while charging, or both. Immich’s backup is incremental – it tracks which photos have already been uploaded by hash, so duplicate uploads don’t happen even if you reinstall the app or switch phones. Video files are included by default, though you can exclude specific albums or media types from the backup scope if storage is a concern.
Managing Updates and Keeping Immich Current
Immich releases updates frequently – sometimes multiple times per month – and some releases include database migrations that run automatically on startup. Because of this, updating requires a moment of attention rather than blind automation. The correct update sequence is to pull new images, bring the stack down cleanly, and bring it back up:
docker compose pull docker compose down docker compose up -d
Always check the Immich release notes on GitHub before updating. Breaking changes are clearly flagged, and on rare occasions a release will require a manual migration step or note a specific order of operations. Running an older version of the mobile app against a newer server version can also cause sync issues, so updating both together is the safest approach.

Backups of the Immich database are easy to overlook once the app is working smoothly. The photo files themselves are straightforward to back up since they’re just files on disk at your UPLOAD_LOCATION path. The database is where all your metadata lives – album names, face assignments, favorites, descriptions, and sharing links. Immich provides a built-in backup mechanism under Administration > Jobs that exports the database to a file inside the upload directory, meaning a single backup of that folder covers both your photos and all associated data. Schedule that job to run daily, and make sure the destination is included in whatever off-site or redundant backup strategy you already use for your server.





