I made this as a guide for myself to upgrade to Mojave but included the paths to past macOS versions below. Please read through this carefully, especially if upgrading from macOS Sierra as Apple notes a special use of the --applicationpath argument for the createinstallmedia command.
Download your macOS installer from the Mac AppStore and prepare your USB disk for the installer. Instructions for each will be found below.
To download macOS Mojave or High Sierra for this purpose, download from a Mac that is using macOS Sierra 10.12.5 or later, or El Capitan 10.11.6. Enterprise administrators, please download from Apple, not a locally hosted software-update server.
From [Apple Support][d8da3f22]