Apple have posted a set of download links for installers for older versions of macOS on their website here:
https://support.apple.com/en-us/HT201372
There’s a teeny-tiny problem with the macOS Sierra installer though: running the createinstallmedia
command as suggested ends up with an infinite loop of createinstallmedia
spawning new copies of itself, until the computer’s resources are exhausted (a fork bomb)!