Error in windows 11 Docker WSL2
I keep receiving below errror trying setup on windows 11 Docker Personal:
Initializing Immich v1.132.3
Detected CPU Cores: 22
Starting api worker
Starting microservices worker
[Nest] 7 - 05/18/2025, 11:08:34 AM LOG [Microservices:EventRepository] Initialized websocket server
[Nest] 19 - 05/18/2025, 11:08:35 AM LOG [Api:EventRepository] Initialized websocket server
microservices worker error: Error: getaddrinfo ENOTFOUND database, stack: Error: getaddrinfo ENOTFOUND database
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
microservices worker exited with code 1
Killing api process
Initializing Immich v1.132.3
Detected CPU Cores: 22
Starting api worker
90 Replies
:wave: Hey @Hypolumar,
Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:.
References
- Container Logs:
docker compose logs
docs
- Container Status: docker ps -a
docs
- Reverse Proxy: https://immich.app/docs/administration/reverse-proxy
- Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA
Checklist
I have...
1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time).
2. :blue_square: read applicable release notes.
3. :blue_square: reviewed the FAQs for known issues.
4. :blue_square: reviewed Github for known issues.
5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy).
6. :blue_square: uploaded the relevant information (see below).
7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable
(an item can be marked as "complete" by reacting with the appropriate number)
Information
In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider:
- Your docker-compose.yml and .env files.
- Logs from all the containers and their status (see above).
- All the troubleshooting steps you've tried so far.
- Any recent changes you've made to Immich or your system.
- Details about your system (both software/OS and hardware).
- Details about your storage (filesystems, type of disks, output of commands like fdisk -l
and df -h
).
- The version of the Immich server, mobile app, and other relevant pieces.
- Any other information that you think might be relevant.
Please paste files and logs with proper code formatting, and especially avoid blurry screenshots.
Without the right information we can't work out what the problem is. Help us help you ;)
If this ticket can be closed you can use the /close
command, and re-open it later if needed.Please post your compose and env
@Mraedis I think i dont have .env file. Only compose .
i think hardcoded environment variables directly in the docker-compose.yml
Try adding
To the ml container
you mean like this:
version: '3.8'
services:
db:
image: postgres:14-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: immich
volumes:
- db_data:/var/lib/postgresql/data
redis:
image: redis:6-alpine
restart: unless-stopped
volumes:
- redis_data:/data
backend:
image: immich/backend:latest
depends_on:
- db
- redis
restart: unless-stopped
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- DB_DATABASE=immich
- REDIS_HOST=redis
- REDIS_PORT=6379
- JWT_SECRET=change_this_to_a_real_secret
ports:
- "2283:2283"
volumes:
- immich_data:/app/data
ml:
image: immich/ml:latest
depends_on:
- db
- redis
restart: unless-stopped
environment:
- DB_HOST=db
- DB_PORT=5432
- DB_USERNAME=postgres
- DB_PASSWORD=postgres
- DB_DATABASE=immich
- REDIS_HOST=redis
- REDIS_PORT=6379
- ML_SECRET=change_this_to_a_real_secret
ports:
- "2293:2293"
volumes:
- ml_data:/app/data
volumes:
db_data:
redis_data:
immich_data:
ml_data:
What the heck happened there?
Did you ChatGPT this?
yesss ๐ฆ
Don't do that
I am novice, sorry
Delete everything you have, use ONLY this compose:
Use this env:
But maybe change the postgres password if you really want to.
sorry, but is it possible for you to point me to official steps to setup Immich on widows 11 including where to keep those env file and docker file - in same folder?
I used chatgpt for all till now
https://immich.app/docs/install/docker-compose/
This is the same on windows and linux really, "mkdir" means "make the directory" and "cd" means "go inside the folder"
1. Make a folder for immich, jike you used "ImmichHot" for instance
2. Go inside the folder, make a text file called
docker-compose.yml
and put the contents I pasted above inside
3. make a text file called .env
the dot at the start is important, put the env I pasted above inside
Not sure how to get docker compose to work here though ๐Side note; how does your backup strategy look like?
@Mraedis @Daniel thanks but actually i have a laptop with internal nvme ssd and i have partitioned it and created another volume 500 GB for ImmichHot -- the intention was to let ML (face / object /geolocation detection, grouping to be fast) (fastest IOPS).
And have bought a separate DAS (USB 3.2 10gbps ) and put 2x4tb HDD in it. Naed 1x4tb as MediaSrc and another 4tb as MediaBkp. Intention is to offload all media from ImmichHot to MediaSrc when ML is done.
And nightly delta backup routine from MediaSrc to MediaBkp
I am trying to understand how to fit instructions by @Mraedis into my storage strategy ๐
Yeah that won't work ๐
What you want for fastest response time is thumbnails (and the database!) on your SSD, and the images on your DAS
https://immich.app/docs/guides/custom-locations/ this is an example, do not blindly copy it
relevant would be
- ${THUMB_LOCATION}:/usr/src/app/upload/thumbs
Do not, under any circumstances, move files around
if immich is not the one doing the moving, you're going to break things
ML will be fine with reading from your HDDs, it does not need more speed
Wait actually if you will be moving the entirety of the library, not just random sets then that will work, sorry for the confusion
This requires composing down, moving the folder, changing the UPLOAD_LOCATION in the env and composing upHmmm, I am trynig to make sense of all documentation from the URL you shared with help of chatgpt and my storage drives. My understanding was that since ML needs higher IOPS, internal temp storage for sometime would help, but as you said it wont.
the storage will not be the limiting factor in ML
processing will very likely be your bottleneck
yes, the first nightly will copy all, then following nightly jobs will copy the delta
My pc processing spec looks like below:
Processor Intel(R) Core(TM) Ultra 7 155H 3.80 GHz
Installed RAM 32.0 GB (31.5 GB usable)
System type 64-bit operating system, x64-based processor
so I guess this would be enough, without bottleneck?
Probably, you can run it off your SSD and move the folder later for sure
But keep the database and thumbs on the SSD like I suggested
that will make immich feel very responsive
Make special note of the
pgdata:
change I showed you
https://immich.app/docs/install/requirements/#special-requirements-for-windows-users
If you do not put postgres on a docker volume when hosting on Windows, it will breakOK, let me just go through everything you said and try to make sense of it and experiment implementing it.
Thanks!
if you have doubts ask here, not chatgpt ๐
What should i mention in place of following 3 values?:
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
i think that's not acceptabele values right
No that's how it works
so even if i keep that as-is, no issues?
it's not hackable remotely?
What would be hackable there?
since people can read this password here in group chat
they can't check media in my immich folders?
Also, side question -- I have around 1.5 TB media data now that i want to move to UPLOAD_LOCATION="F:/ImmichHot/storage" which is only 500 GB slice of a 1TB internal ssd of windows laptop.
So, I will just upload first day upto 500 GB from my 1.5 TB collection. And thinking to run a nightly to move that 500 GB to external hdd MediaSrc (D:) in a DAS.
But to before I move that first batch of 500GB media from "F:/ImmichHot/storage" to MediaSrc (D:), I must know that the ML related processing is complete for all 500 GB data. How do I check that?
- And where do I define this location MediaSrc (D:) for my purpose stated?
- And then I will use an app to do nightly backup of all-time media in MediaSrc (D:). I guess we dont need to mention this location anywhere in immich related meta right?
normally you will never expose your DB externally, so even if we know your password, there's nothing we can do. but anyway, if you want to modify those values you have to edit the .env file
https://github.com/immich-app/immich/releases/latest/download/example.env (rename to .env)
no, once you upload your library to Immich and is copied to UPLOAD_LOCATION, you are not suppose to modify that folder directly and move assets out of it
i am confused because here I saw hope -https://discord.com/channels/979116623879368755/1374034370637201479/1374735236407103508
aaah I think I see what was meant
so I will have to do that change every day, not possible
maybe you are confused what Immich is actually for... this is a self hosted service like google photos (and whatever iOS equivalent), you upload assets to it and they stay in the library
where is your 1.5Tb data stored?
I understand, I am currently using Apple Photos Library but it's creating issues on and off. So, I am planning to move to Immich and let me and my family upload to same library and view anytime in network or remotely
1.5 tb is in external ssd
is that always connected?
exported via apple photos gradually
external ssd not connected always, its via usb nvme enclosure
And thinking to run a nightly to move that 500 GB to external hdd MediaSrc (D:) in a DAS
is this that same media ?yes, first batch of that 1.5 tb
you could have your library stored in an external media, while everything else is in your internal SSD, but ideally it should be always available (attached)
something like this
duplicate
hmmm. I am trying to follow your responses. SO, attached is how my stroage drives look like. C: and F: are same internal ssd of windows laptop, just logical volume splits.
D: and E: are from external DAS that I always plan to keep connected via usb to this laptop and intends to serve as permanent Immmich library

my DAs has more 1 & 2 tb drives but I dont show here because it should not be usable by Immich
but there's a slight chance that I may either shut down laptop on and off
Or shut down the DAs sometimes. I hope that doesnt break anything related to Immich library/database/ML
so you're saying I should not use # The location where your uploaded files are stored
UPLOAD_LOCATION="F:/ImmichHot/storage"
Instead, I should use UPLOAD_LOCATION="D:/ImmichHot/storage"?
duplicate, sorry what do you mean?
I am so getting confused right now ๐ฆ
is that clearer? your DB should be in F too sorry your DB should be in a volume https://immich.app/docs/install/requirements/#special-requirements-for-windows-users
ok so changing from postgres to pgdata wont have any disadvantage? I think that's already done in the file shared by @Mraedis here - https://discord.com/channels/979116623879368755/1374034370637201479/1374730555920355511
ok great, so I understand now that F: (internal ssd portion) is used as temp storage until ML is completed and then automatically media moves to D:,removing it from F:?
- D:/ImmichHot/storage:/usr/src/app/upload
- F:/ImmichHot/storage/thumbs:/usr/src/app/upload/thumbs
- F:/ImmichHot/storage/encoded-video:/usr/src/app/upload/encoded-video
- F:/ImmichHot/storage/profile:/usr/src/app/upload/profile
- F:/ImmichHot/storage/upload:/usr/src/app/upload/upload
kind of, you'll need to enable storage template so the files are moved to D https://immich.app/docs/administration/storage-template
everything else (thumbs, encoded videos) will be served from F
Thank you, you guys are an awesome support. I will try these
and don't forget to do proper backup
@NoMachine proper backup? Nightly backup strategy from D: not enough?
a copy is not a backup ๐
๐ฎ means more expenses like off-site NAS backup or cloud backup in TBs?
the best way of deploy in windows is usin wsl in terminal, your directories appear like linux an works realy good, use the route
I mean something like deduplication backup tools (like borg, restic, etc), having an offsite/cloud option would be ideal, but in the end, it all depends how much you care about keeping your library safe ๐ฌ
Oh ok ๐ฆ Iโm not that technical
Btw one question- will it be better if I setup Immich on Mac mini M1 (I will buy used) instead on Dell laptop I have? DAS will still hold media data.
But you're sure self-hosting Immich is the right call for you?
Why not?
I wanna save on subscription long run
If you're saying you're not "technical" enough for proper backups self hosting your precious memories may not be a good idea IMHO
Self-hosting rarely saves money
It's very important data and if you're not confident about what you're doing then you risk losing it
I bought external DAS and hdds for it only ๐ฆ
I canโt return now
Really?? Then why the hassle? ๐ฎ
Privacy, control, fun
Sorry but I mean cloud providers wonโt steal my data really right, they use it anonymously to train models
Fun?
People consider self-hosting a hobby
Itโs a hobby risky for people with less budget huh it seems ๐
I mean, it's not a cheap hobby usually, but there definitely are people that manage on really cheap equipment
It all depends on what you're willing to accept, both in terms of performance and in terms of risk
Got you. Thanks
But really which ones best for Immich performance vs heat management
I feel win 11 Immich container via docker heats up over the day since windows consume its own resources
Thoughts?
Iโm refraining from using ChatGPT as you initially advised so asking you experts ๐
Really you should use neither MacOS nor Windows. If you want to choose between the two, MacOS would probably be the better choice and the Mac Mini is incredibly efficient and performant
(but ideally you use Linux)
Gotcha! Ubuntu or Debian? Which one is better for Immich and backups and why?
I prefer Debian personally because Ubuntu sometimes makes changes that veer away from what is widely know as good/stable and causes confusion
for example, snap installs
so annoying
Amazing so I think Debian for me.
Iโll install it and then follow the steps you shared to install and configure Immich on it
Which nightly backup tool you suggest on Debian to copy 1st hdd data of Immich to 2nd hdd?
Restic or Borg are our usual suggestions
Ok let me check if they are free without limits or donations based
they are completely free, command line tools, but there are a lot of GUIs or WebUI available
I personally use backrest in docker
Gotcha, thanks! But if I thought if I use Debian I wonโt have to use docker for Immich, unlike in windows 11
Then in Debian I will need to install backrest so not resource hungry?
You should probably still use docker
But it'll work a lot better than in windows
Ok, so install docker in Debian first and then Immich and then backrest
Thanks for this formula ๐
Is GNOME better than KDE Plasma for Debian?
Chatgpt tell me this which gives me impression that KDE might be better to install but I am not sure, as new Linux user

that's just a matter of personal preference. both are pretty good.
me personally, I like my servers headless
Installing Debian twice has ruined my win 11 bootloader today
I tried Debian live too
I think Iโm better off with docker on windows 11 lol
Let the pc burn
You can run. Vm on windows too @Hypolumar
@Mraedis ok, which one do you suggest? Free
@NoMachine What's the difference between
- ${EXTERNAL_LOCATION}:/usr/src/app/upload/library
and
- ${EXTERNAL_LOCATION}:/usr/src/app/upload
So, I have decided to install Immich via docker desktop in win 11. Can you check my env and docker files to ensure it will work 100%?
I have changed letters of my drives (internal and external).
D:/ is internal NVME's partition.
E:/ is external HDD that will serve as primary backup location of media uploaded from mobile app.
F:/ will be backup of E:/ all time
/usr/src/app/upload
is an internal directory, it contains multiple folders:
So if you use ${EXTERNAL_LOCATION}:/usr/src/app/upload/library
you are only putting that one directory on EXTERNAL_LOCATION
But if you use ${EXTERNAL_LOCATION}:/usr/src/app/upload
then you are putting all of the directories thereSorry, whatโs the difference in purpose between:
/usr/src/app/upload/upload
/usr/src/app/upload/library
@Mraedis sorry for asking too much, but can you please fix my env and compose files?
Iโm literally scratching my head over the config for sometime now
๐ฆ
upload is where files get uploaded
library is where files are moved to if you enable storage templating
You're not supposed to use the + at the start of the line @Hypolumar it's to indicate that the line was added
What is the actual folder you want to use on your HDD and SSD @Hypolumar ?
You seem to be nesting a lot of things
Actual folder to upload to in external hdd - E:/ImmichHot/storage
And for the SSD?
er HDD, whatever
Internal nvme partition to use - D:/ImmichHot/storage/
F:/ is where Iโd like to keep backup
Env:
(abbreviated) Yaml:
I have left "backups" on your HDD because these are database dumps not full immich backups, so they don't take a huge amount of space
Aaah! I thought backup folder is literally backup of my media uploads, so I could skip setting up nightly backup with app like backrest
Thanks
Can I update localtime:ro (I guess thatโs for Romania?) to my countryโs abbreviation (UAE)?
lol, good one. That means read only
So, no. You should set your timezone in the .env as we explain the example
Thanks