Does anyone know if there’s a way to self host/impersonate iCloud? I’d like to back my iPhone up locally.

You can do manual backups in macOS using Finder, or iTunes on Windows.

There's also a Program called "Apple devices" I believe from Apple for Windows that will let you backup your iPhone/iPad.

If you configure a password for your backup it will backup more (confidential) data than if you don't encrypt your local backup.

For pictures you can use https://immich.app/

Immich is probably the best option

I'm sure grandparent meant to modify it so they'd just have to click "Backup to cloud" on their iPhone and instead of the iPhone sending their files to Apple's servers, it sends them to a local backup server...

A lot of iPhone apps can backup the iOS photo library these days, including the abovementioned Immich, Google Photos, and Dropbox.

Immich can get pretty close to that experience, with the iPhone app and a local immich instance.

Or ente photos: https://ente.io/