1. Download the macOS Installer from the App Store or a Website

Typically, this will download the installer into the /Applications folder.

macOS Monterey AppStore

macOS Monterey AppStore

OR

Run the Install.pkg on macOS


2. Create and Mount a DMG

hdiutil create -o /tmp/Monterey -size 16384m -volname Monterey -layout SPUD -fs HFS+J

Output of this command:

created: /tmp/Monterey.dmg

hdiutil attach /tmp/Monterey.dmg -noverify -mountpoint /Volumes/Monterey

Output of this command:

/dev/disk5          	Apple_partition_scheme
/dev/disk5s1        	Apple_partition_map
/dev/disk5s2        	Apple_HFS                      	/Volumes/Monterey


3. Copy Installation Files to the Mounted Volume