For several years, all the photos I took were scattered across my phone or various cloud storage services; it had become impossible to find exactly what was where. On top of that, the privacy policies of these services and their ever-increasing costs were additional burdens. The idea of taking complete control of my own photo archive, both for data security and long-term cost advantages, led me to install Immich. Immich, as an open-source and powerful personal cloud storage solution, allows you to securely store your photos and videos on your own server. In this guide, I will explain how you can complete the Immich installation in four fundamental steps.
This installation process becomes quite manageable, especially if you have a basic understanding of Linux and Docker. Our goal, unlike complex enterprise systems, is to keep control of our personal data and to do so while benefiting from the practicality offered by modern technology. Let’s embark on this journey together and revive your digital photo archive.
Why Should You Install Immich on Your Own Server?
While commercial cloud storage services offer convenience at first glance, they can harbor serious disadvantages in the long run regarding privacy and cost. Self-hosted solutions like Immich eliminate these drawbacks. Setting up your own photo cloud gives you full control over your personal data; your data is never scanned or used for advertising purposes by third parties.
Furthermore, when you think long-term, the one-time server cost and storage expenses can become much more economical compared to monthly or annual subscription fees. Immich not only provides storage but also offers all the features you see in modern cloud storage services, such as smart facial recognition, object detection, automatic backup, and advanced search, all for free. This makes it an attractive option for anyone who values data privacy and wants to manage their budget wisely.
While the setup of these systems might seem daunting at first, you’ll find that they are quite logical and manageable when you follow the correct steps. Such technically deep projects also offer an opportunity to enhance your knowledge of Linux system administration and container technologies.
Step 1: Preparation - Server and Docker Installation
Before you begin installing Immich, you need to ensure your system meets some basic requirements. The first and most important step is to prepare a server where Immich will run. This could be an old computer running at home, a Raspberry Pi, a NAS device, or a virtual private server (VPS) you rent in the cloud. Whichever hardware you choose, ample storage, sufficient RAM, and processing power are critical. As your photo archive grows, your storage needs will also increase, so it’s beneficial to be a bit generous at the start.
I recommend using a Linux distribution (such as Ubuntu LTS, Debian). Linux provides a stable platform for such server applications and facilitates access to necessary tools. Once your server is ready, we will primarily need two main technologies: Docker and Docker Compose. These tools enable Immich and all its dependencies (like PostgreSQL database, Redis caching service) to be installed in isolated environments, easily manageable.
If Docker and Docker Compose are not installed on your server, you will need to install them. For Ubuntu and Debian-based systems, the installation steps are generally as follows:
-
Docker Installation:
# Install necessary packages sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common -y # Add Docker GPG key curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg # Add Docker repository echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker CE sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -yAfter installation, start the Docker service and enable it to start automatically on system boot:
sudo systemctl start docker sudo systemctl enable dockerAdd your user to the
dockergroup so they can run Docker commands withoutsudo(this makes running commands more convenient):sudo usermod -aG docker $USER # For these changes to take effect, you may need to log out and log back in, or use the 'newgrp docker' command. -
Docker Compose Installation: Current Docker versions come with the
docker-compose-pluginpackage. If you need to install it separately, refer to the official documentation. You can usually check with thedocker compose versioncommand.
Once these preparations are complete, your server is ready to install Immich. Finally, it’s good practice to create a dedicated directory on your server to store your Immich files and database. For example:
mkdir -p ~/immich/data
This directory will be used for Immich’s own configuration files, its database, and most importantly, your photo library. Make sure the disk containing your storage space is mounted to this directory.
File Permissions and Security Notes
After installing Docker on your server, it’s important to pay attention to some key points regarding security and practicality. Having the user running Docker services in the docker group allows you to run commands like docker compose without sudo. However, this increases the user’s privileges on the system, so it’s important to manage this group carefully. On your own server, this usually isn’t an issue as it’s for personal use, but in a shared environment, more caution may be needed.
Additionally, for Immich to interact with your photo files, the directory on your server where your photo archive is located must have the correct permissions. Docker containers run in isolation from the host system by default. This isolation requires specific volume mappings for the Immich container to access your host’s file system. During these mappings, you must ensure that the container has read and write permissions to the specified directories. This usually involves matching the owner or group of the host directory with the Docker user or an ID that Docker requires. This issue is one of the most common problems encountered during installation and will be discussed in more detail when configuring the docker-compose.yml file in the next step.
Step 2: Immich Docker Compose Configuration
Now that Docker and Docker Compose are installed on our server, we can begin installing Immich in a containerized manner. In this step, we will configure the necessary services (Immich application server, PostgreSQL database, Redis caching service) using Immich’s official docker-compose.yml file. This file defines how all dependencies will run, which ports will be used, and which storage volumes will be mounted.
First, navigate to the directory you created to store your Immich files (e.g., ~/immich). Then, download the latest docker-compose.yml file from Immich’s GitHub repository. You can do this with the curl or wget command:
cd ~/immich
curl -L https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml -o docker-compose.yml
This command will download the docker-compose.yml file for the latest released version of Immich to the current directory. After downloading the file, you will need to open it with a text editor and modify it according to your needs.
nano docker-compose.yml
# or
vim docker-compose.yml
The file content contains several critical sections:
-
servicesSection: This section defines Immich’s main service (immich-server), the database (immich-db- PostgreSQL), and the caching service (immich-redis). It specifies which Docker images these services will use, which ports they will expose, and which environment variables they will receive. -
volumesSection: This section is crucial for ensuring your data persists. It defines how directories on your host machine will be mounted to corresponding locations within the container../immich-data:/usr/src/app/immich-files: Where Immich will store media files (photos, videos)../immich-db:/var/lib/postgresql/data: PostgreSQL database files../immich-redis:/data: Redis data files.- Important: To introduce your own photo library to Immich, you typically need to bind this
immich-filesvolume to a host directory where your photo archive is located. You can do this directly withindocker-compose.yml, or you can specify it later from the Immich interface. However, if your photos are already in a specific directory, directly mounting this directory simplifies the initial setup. For example, if your photos are in~/my-photos, you could map theimmich-filesvolume like this:./my-photos:/usr/src/app/immich-files. However, using the default setting indocker-compose.ymland then adding this directory as a “Library” from the Immich interface is often a cleaner approach.
-
environmentSection: All necessary configuration settings for the Immich server are located here.IMMICH_ENCRYPTION_KEY: This is a critical key Immich uses to encrypt your data. You must create a very secure and complex key and store it in a safe place. Losing this key can result in losing access to data encrypted by Immich. You can generate this key using a password manager or a secure random key generator.DB_PASSWORD: Set a strong password for the PostgreSQL database.REDIS_PASSWORD: Set a strong password for the Redis service.TZ: Set your server’s timezone (e.g.,Europe/Istanbul).
# Example docker-compose.yml modification (sections you need to change)
# This is just an example; it is recommended to check the official Immich documentation.
services:
immich-server:
image: immich/immich-server:latest
container_name: immich_server
ports:
- "2283:3001" # Port for the web interface
volumes:
- immich-files:/usr/src/app/storage # Your photos will be stored here
- ./configs:/usr/src/app/config # Immich configuration files
environment:
- IMMICH_ENCRYPTION_KEY=YOUR_VERY_SECURE_ENCRYPTION_KEY_HERE # Please change!
- DB_HOST=immich-db
- DB_PORT=5432
- DB_USERNAME=postgres
- DB_PASSWORD=YOUR_SECURE_DB_PASSWORD_HERE # Please change!
- REDIS_HOST=immich-redis
- REDIS_PORT=6379
- REDIS_PASSWORD=YOUR_SECURE_REDIS_PASSWORD_HERE # Please change!
- TZ=Europe/Istanbul
depends_on:
- immich-db
- immich-redis
restart: unless-stopped
immich-db:
image: postgres:15 # Or the current version supported by Immich
container_name: immich_db
volumes:
- immich-db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=YOUR_SECURE_DB_PASSWORD_HERE # Must be the same as above
restart: unless-stopped
immich-redis:
image: redis:7-alpine
container_name: immich_redis
volumes:
- immich-redis:/data
command: redis-server --requirepass YOUR_SECURE_REDIS_PASSWORD_HERE # Must be the same as above
restart: unless-stopped
volumes:
immich-files: # This will be your photo storage directory
immich-db:
immich-redis:
After Saving the File:
Once you’ve completed the configuration, save the file and exit the editor. Then, while in the ~/immich directory, you can start the Immich services by running the following command:
docker compose up -d
The -d flag ensures that the services run in the background (detached mode). This command will download the necessary Docker images and start the services according to your specified configuration. If you encounter any errors during installation, you can examine the service logs with commands like docker compose logs -f immich-server.
Step 3: Initial Setup and Library Configuration
Now that we have successfully started the Immich services, it’s time to perform the initial configuration and introduce your photo library to Immich. This is a critical step that allows Immich to scan, index, and make your photos manageable.
Open your web browser and navigate to the Immich server port you specified in the docker-compose.yml file. Typically, this will be in the format http://<server_ip_address>:2283. If you don’t know your server’s IP address, you can use the commands ip a or hostname -I in the terminal.
When you access Immich for the first time, you will be greeted by an “Admin Account Setup” screen. Here, you will be asked to set an email address and password for the Immich administrator. Make sure to save this information securely, as this account will have all administrative privileges on Immich.
After creating your account, Immich will direct you to the main dashboard. Now it’s time to define your photo library. Go to the “Libraries” tab from the left menu. Immich may have a default storage path defined, but if you want to use your own photos, click the “Add Library” button.
In the window that appears, enter a meaningful name for your library (e.g., “My Main Photos”, “2020-2024 Archive”). Then, in the most important field, “Path”, you need to enter the full path to your photo archive directory on your server. This path is the path on your host machine, not inside the Docker container.
Important Note: File Permissions and Path Matching
One of the most common issues here is file permissions and path matching. The Immich container must have read and write permissions to this photo directory on your host machine. If you directly bound the immich-files volume to a host directory in your docker-compose.yml file (e.g., ./my-photos:/usr/src/app/storage), then the path you should specify in the Immich interface will usually be the storage folder inside the container. However, if you used the default immich-files volume and your photos are in a location like ~/my-photos, then when you “Add Library” from the Immich interface, you need to specify Immich’s internal storage path (e.g., /usr/src/app/storage/my-custom-library) and map this path correctly in Docker Compose.
The cleanest approach is usually as follows:
- In the
volumessection of yourdocker-compose.ymlfile, bind your main photo storage on your host (e.g.,/home/username/my-photos) to a location Immich expects (e.g.,/usr/src/app/storage/host-photos).volumes: - /home/username/my-photos:/usr/src/app/storage/host-photos # ... other volumes - When you click “Add Library” from the Immich interface, specify the container-internal path, such as
/usr/src/app/storage/host-photos, as the “Path”.
Checking File Permissions:
If Immich cannot scan or add your photos, the first place to look is file permissions. On your server, navigate to the directory where your photo archive is located and ensure that the user running the Immich container (which usually matches a UID/GID used by Docker, sometimes 1000, or can be checked with docker compose ps) has read and write permissions. If necessary, you can use the command sudo chown -R <immich_user_id>:<immich_group_id> /path/to/your/photos.
After adding the library and ensuring the path is correct, click the “Scan Library” button. Immich will now begin scanning all photos and videos in this directory. This process may take some time, depending on the size of your library. Once the scan is complete, your photos will start appearing in the Immich interface.
Step 4: Mobile and Web Interface Connection and Usage
Now our Immich server is running, the database is configured, and our photo library is defined. In this final step, we will cover how to connect to Immich both via a web browser and from our mobile devices, as well as basic usage features.
Web Interface Access:
As mentioned earlier, you can access Immich’s web interface by going to http://<server_ip_address>:2283 in your web browser. Log in with the admin account you created during the initial setup. The dashboard will show storage usage, recent uploads, and the overall system status. From the left menu, you can browse your gallery, create albums, search for photos, and organize them.
Mobile App Connection: One of Immich’s most powerful features is its ability to perform automatic backups from your mobile devices. To do this, you need to download the Immich mobile application available on iOS and Android platforms.
- Download the App: Search for and download the “Immich” app from the App Store or Google Play Store.
- Configure Server Connection: When you open the app, it will ask you to enter the server address. Enter your Immich server’s IP address and the port you configured (e.g.,
http://192.168.1.100:2283). If you have configured external access to your server (e.g., with a domain name and HTTPS), use that address. - Log In: Then, log in by entering the email address and password of the admin account you created in the web interface.
- Configure Backup Settings: After logging in, the app will ask you to configure backup settings. You can specify which folders to back up (e.g., Camera Roll), whether to back up over Wi-Fi or mobile data, and how frequently to back up. When you enable this feature, new photos on your phone will automatically be uploaded to your Immich server.
Additional Features and Tips:
- Security: If your server is accessible externally, always use HTTPS and set strong passwords. Setting up a reverse proxy (like Nginx, Caddy) to access your Immich instance via a domain name with HTTPS is the most secure method.
- Storage Management: Monitor your server’s storage space as your photo archive grows. Add additional disks or use larger disks if necessary.
- Backup: Remember that the Immich server itself should also be backed up regularly. Backing up both Immich’s own database and the directories containing your photo files is vital.
- Performance: Initial scanning and indexing operations can take time for large libraries. Make sure it’s running in the background and be patient. Features like facial recognition and object detection may also require additional processing power.
Setting up your own photo cloud with Immich not only securely stores your photos but also gives you back control over your data. These four steps will guide you on this journey.
Conclusion
Setting up your own photo cloud with Immich is a powerful way to regain control over your personal data. The four steps we covered in this guide – server preparation, Docker Compose installation, library configuration, and mobile/web interface connection – make this process manageable. Now your photos can be stored securely, under your control, without being at the mercy of commercial services.
After this setup, you can manage your digital memories more easily with Immich’s advanced search features, facial recognition technology, and automatic backup synchronization. Remember, while such self-hosted solutions may require some technical knowledge initially, the flexibility, privacy, and cost advantages they provide in the long run are well worth the effort. If you want to take control of your data, Immich is an excellent starting point.