I did exactly that with maybe the same mac mini. I don’t have a write up though :-(. Here is what I did: On a different computer (Windows), download OMV (open media vault).iso and use balena etcher to write to a bootable USB
Put it in the mac mini and started it holding down the option key to get the “choose your boot disk” selection and chose the USB
Followed the on screen installer accepting the defaults.
Under the hood it is installing Debian 11 with OMV running/controlling all the file sharing (and other) functions.
Sorry it isn‘t step by step with screen shots, but maybe enough to point you in the right direction?
Have fun.