Storing photos directly from iPhone to home server

My homeserver / lab is a Lenovo thinkCentre from a few years ago.

It has 500gb of storage (HDD) and running windows 11 home.

I can remote into it from my mac.

I currently pay ~$3 a month to apple for 50GB of iCloud storage.

I bought the thinkcentre so I can learn more about self hosting. Whether it be storing things myself or learning more about networking.

Any suggestions of an ideally free app / method to upload all my iPhone's photos to my 'server' ?
I'd like it to auto update too. Essentially if I delete a picture or video on my iPhone it will delete it on the server too.

I saw someone mention ICloudPD. Any good? Other suggestions?
Thanks!