Immich and Postgres
Hi there guys I'm newer with all this self hosting stuff and docker. I've managed to do a few docker containers already and am now working on Immich however I seem to keep getting stuck in a roadblock with Immich and Postgres. I've never really tinkered with DB's before. I do have Postgres installed and I can also log into it. However whenever I start up Immich for the first time it fails to connect to Postgres no matter if I use the docker compose that's provided officially or the AIO compose. I use docker compose files as they're eaiser for me use just "figure out" little by little for me. I'm sorry if it's all a bit complicated or I worded things crappy.
Here are also the logs to my compose files
https://github.com/MoldyTaint/Server-setup/blob/main/Immich
https://github.com/MoldyTaint/Server-setup/blob/main/Postgres
GitHub
Server-setup/Immich at main · MoldyTaint/Server-setup
Contribute to MoldyTaint/Server-setup development by creating an account on GitHub.
GitHub
Server-setup/Postgres at main · MoldyTaint/Server-setup
Contribute to MoldyTaint/Server-setup development by creating an account on GitHub.

3 Replies
That looks like an unusual image. Please give the official deployment a try first (https://immich.app/docs/install/docker-compose)
Docker Compose [Recommended] | Immich
Docker Compose is the recommended method to run Immich in production. Below are the steps to deploy Immich with Docker Compose.
I actually did the official deployment before I tried the AOI, I wasn't opposed to the official image and would prefer to run that over the AIO however that's just what I had up at the moment which still gave the same results. Was hoping there might be an obvious error I did and don't see. I'll throw the AIO official one up in a few when I have a chance at work
I noticed that you are running adminer on port 5432. So you're not actually running postgres on that port, but the web admin gui. Thus, immich is failing to connect to the database on that port, since it's actually sending database requests to the admin gui by mistake.
You should either:
1. Run the immich container on the same docker network as the database and then change the env variable
DB_HOSTNAME
to "db" (which is the docker service name for the container), or
2. Expose a port on the postgres container (add port: 5432:5432
to your db
entry. Then immich should be able to connect to it. You will need to change the admin gui to run on a different port otherwise you'll have a conflict. So change it to something like 5433:8080
instead.