From LedHed's Wiki
Contents
Overview
This article will provide steps on how to create a bootable USB stick for bare metal installations of MacOS.
Download OS
Browser/App Store
From a Mac, open Safari and browse to
https://support.apple.com/en-us/102662#appstore
Click the link for the OS version supported by your hardware. This will likely open the App Store, click [Get] and you'll be presented with an option to download (or possibly upgrade).
Terminal
Open a terminal and navigate to your Downloads folder. Show available installers for your hardware:
softwareupdate --list-full-installer
You'll see a list of installers, make note of the version number you'd like to download.
Finding available software Software Update found the following full installers: * Title: macOS Monterey, Version: 12.7.4, Size: 12117810KiB, Build: 21H1123 * Title: macOS Big Sur, Version: 11.7.10, Size: 12125478KiB, Build: 20G1427 * Title: macOS Catalina, Version: 10.15.7, Size: 8055650KiB, Build: 19H15
Grab the version number and run this command:
softwareupdate --fetch-full-installer --full-installer-version 12.7.4
Create Media
Command Line Tools
softwareupdate --list-full-installer
softwareupdate --fetch-full-installer
Reference
https://geekschalk.com/how-to-download-macos-installers-for-new-old-versions/