Immich runs a photo library with background processing and a database that tracks your assets. Use its maintained release Compose file so the server and PostgreSQL extensions stay compatible. The published minimum is 6 GB RAM and 2 CPU cores, with 8 GB RAM and 4 cores recommended. Keep database storage on a local SSD rather than a network share.
Before you start
Complete the Docker server setup. Plan disk space for originals, generated previews, encoded video and backups. Choose a final HTTPS domain such as photos.example.com. Your Immich account will be separate from your OwnServa account.
mkdir -p ~/selfhosted/immich
cd ~/selfhosted/immich
umask 077
curl -fL https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml -o docker-compose.yml
curl -fL https://github.com/immich-app/immich/releases/latest/download/example.env -o .env
openssl rand -hex 32
Use the two files from the same release. These download URLs resolve to the current release; read its release notes and record the version before production use. Do not replace the provided database image with a generic PostgreSQL image: Immich needs the extensions and configuration in its release template.
Configure PostgreSQL and photo storage
Open .env in nano. Preserve other upstream settings and set these values:
UPLOAD_LOCATION=./library
DB_DATA_LOCATION=./postgres
TZ=Africa/Nairobi
DB_PASSWORD=REPLACE_WITH_RANDOM_HEX_SECRET
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
Use the random hexadecimal output for DB_PASSWORD. Choose your own IANA time zone if different. Keep the upstream IMMICH_VERSION setting or pin it to the specific supported release you selected; do not invent a version number.
The bundled database service initializes PostgreSQL on its empty data directory, and the application runs its schema migrations. You do not manually create tables. Both ./postgres and ./library must live on suitable storage and remain available after a reboot. Do not change the database path to an empty directory after installation: that looks like a new installation.
In docker-compose.yml, find the web port mapping for the server. Change the host side from 2283:2283 to 127.0.0.1:2283:2283. Preserve the rest of the release file, including its dependency and health-check settings. Do not add a public port to the database or cache.
Start Immich
chmod 600 .env
sudo docker compose config --quiet
sudo docker compose up -d
sudo docker compose ps
sudo docker compose logs --tail=80 immich-server database
Leave time for initialization. From your computer, open a private tunnel:
ssh -L 2283:127.0.0.1:2283 your-user@YOUR_SERVER_IP
Visit http://localhost:2283. Before giving other people access, complete administrator registration yourself.
Create your first administrator
Choose Getting Started and enter your email, name and a strong password. The first registered user becomes administrator. Sign in and review Administration settings. Create additional users from Administration → Users rather than sharing the administrator password.
Upload a small test photo and confirm that its thumbnail appears and that you can download the original. Processing a large library can take hours; prove the small case first. Configure the HTTPS reverse proxy for photos.example.com to 127.0.0.1:2283, then use that final URL in the mobile application. Test mobile uploads on Wi-Fi before enabling a large automatic upload.
Back up the database and originals
Immich's database backups contain metadata, not your photos and videos. Preserve both a usable PostgreSQL backup and UPLOAD_LOCATION, including the originals. Copy backups off the server and test a restore using the matching release instructions. A photo-sync application is not a substitute for an independent backup.
Review release notes before every upgrade. Follow the upstream restore procedure rather than importing an old dump into a randomly chosen new database image.
Troubleshooting
- The welcome screen returns unexpectedly: check that the original database directory is mounted. Do not create another admin to cover up a missing database.
- Database or vector-extension errors: restore the matching upstream Compose file and read the release migration notes.
- Thumbnail jobs are slow: check CPU, memory and free disk space; allow background jobs to finish.
- Uploads fail through the domain but work through SSH: check the proxy's request size, timeout and upload configuration.
Official references
Check Immich requirements, Docker Compose installation, first-user setup and backup and restore. The Compose example is intentionally downloaded from upstream so its required services stay together.
Written by OwnServa. Check the official release notes before updating, keep independent backups and test a restore before relying on your installation.