These might be useful ... do delete the MAMP you attempted to install first ...
https://it.nmu.edu/docs/allowing-third-party-applications-install-macbook
Apples official doc:
https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac
Another alternative ... install VirtualBox and acquire your 'flavor' of Linux operating system (same as where you host) from
https://www.osboxes.org/virtualbox-images/
Once the VB Guest OS up and running, install Moodle via git.
https://docs.moodle.org/310/en/Git_for_Administrators
One will have to tweak OSBOXES setting for the guest OS's upwards ... memory/space, etc. but doable.
Another nice thing about this approach ... one can create and backup courses in VB guest OS and transfer those to your server's file system repo's or attached storage devices that are linked in true production server via scp ... 'sane' gui restrictions don't get in the way. ;)
'SoS', Ken