Create a Bootable macOS Installer Using Terminal

When a Mac encounters a catastrophic system failure, the standard recovery method is to rely on Internet Recovery to download a fresh operating system directly from Apple’s servers. However, this method has significant drawbacks: it requires a highly stable, high-speed Wi-Fi connection, it can take hours to download massive 15GB files, and if Apple’s authentication servers are experiencing downtime, your machine remains completely unusable. To guarantee that you can repair, format, or reinstall macOS on multiple machines instantly, you must rely on physical media. By learning how to create a bootable macOS installer on a USB drive using Terminal, you bypass internet reliance entirely and build the ultimate, offline rescue tool for your Apple ecosystem.

In this advanced system administration guide, we will walk you through the precise steps required to source the official macOS installation files, correctly format your external drive using Disk Utility, and execute the powerful `createinstallmedia` command line utility to compile the bootable image.

Step 1: Acquiring the Proper USB Hardware

Before you begin, you must ensure you have the correct physical hardware. You will need a USB flash drive (or an external SSD) with a minimum capacity of 16GB. Because the macOS installation files are incredibly large (often exceeding 12GB), a standard 8GB drive will fail during the creation process.

Warning: The process we are about to undertake will completely wipe the USB drive. Ensure you have backed up any personal files currently stored on the flash drive before proceeding.

Step 2: Downloading the macOS Installer

To create the bootable drive, you must first download the full operating system installation package to your Mac. Do not use third-party mirror sites, as they can inject malicious code into the installer.

  1. Open the App Store on a functioning Mac.
  2. Use the search bar in the top-left corner to search for the specific version of macOS you want to install (e.g., “macOS Sonoma,” “macOS Ventura,” or “macOS Monterey”).
  3. Click the Get or Download button.
  4. The download will be routed through your System Settings (or System Preferences). Allow the massive file to download completely.
  5. When the download finishes, the macOS installer will launch automatically. Do not click Continue. You do not want to install it on the current machine. Instead, press Command (⌘) + Q to quit the installer.

The installer application (e.g., “Install macOS Sonoma”) is now safely resting in your Mac’s Applications folder.

Step 3: Formatting the USB Drive

The Terminal command requires the USB drive to be formatted in a very specific Apple file system structure to accept the bootable image.

  1. Insert your 16GB+ USB drive into the Mac.
  2. Open Spotlight Search (Command + Space) and type Disk Utility to launch the application.
  3. In the top-left corner of the Disk Utility window, click the View button and select Show All Devices.
  4. In the left sidebar, click the top-level name of your USB drive (the physical hardware, not the indented volume name below it).
  5. Click the Erase button at the top of the window.
  6. Name the drive exactly MyVolume (this specific name is important for the Terminal command later).
  7. Set the Format to Mac OS Extended (Journaled). Do not choose APFS.
  8. Set the Scheme to GUID Partition Map.
  9. Click Erase. Once finished, click Done and close Disk Utility.

Step 4: Executing the Terminal Command

Now that the drive is properly formatted and named `MyVolume`, you can use Apple’s hidden command-line tool to build the bootable media.

  1. Open Spotlight Search and type Terminal to launch the command-line interface.
  2. You must type a specific command depending on which version of macOS you downloaded. If you downloaded macOS Sonoma, carefully copy and paste the following command exactly as it is written:
sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

(Note: If you downloaded a different OS, simply replace the word “Sonoma” with the correct name, such as “Ventura” or “Monterey”).

Completing the Process

  1. Press Enter.
  2. The Terminal will ask for your administrator password. Type it in (you will not see the characters appear on screen, this is a security feature) and press Enter.
  3. The Terminal will warn you that it is about to erase the volume. Type Y to confirm and press Enter.
  4. The process will begin. You will see percentages slowly appear on the screen as it erases the disk, copies the installation files, and makes the disk bootable.

This process can take anywhere from 15 to 45 minutes depending on the read/write speed of your USB drive. Do not close the Terminal window until you see the words Install media now available followed by your standard terminal prompt.

Step 5: Booting from the New Drive

With your offline rescue tool created, you can now use it to repair any compatible Mac.

  • For Apple Silicon (M-series) Macs: Turn the Mac off. Press and hold the power button until you see “Loading startup options.” Your new USB drive will appear on the screen. Click it and select Continue.
  • For Intel Macs: Turn the Mac off. Turn it on and immediately press and hold the Option (Alt) key. Release the key when you see the bootable volumes appear, and select your USB drive.

Relying solely on cloud-based recovery mechanisms leaves your critical hardware vulnerable to server outages and poor internet connectivity. By investing a small amount of time to learn how to create a bootable macOS installer on a USB drive using Terminal, you arm yourself with an indispensable, offline diagnostic tool, ensuring you can completely rebuild a corrupted machine anywhere, at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.