If you have an external storage device, such as a USB or Thunderbolt drive, you can install macOS on that device, then use it as a Mac startup disk.
Make sure that your storage device is plugged into the appropriate port on your Mac.
If you're using a Mac with Apple silicon, plug your storage device into any compatible port except the DFU port. Learn how to identify the DFU port. After macOS installation is complete, you can connect your storage device to any compatible port, including the DFU port.
Plug your storage device into any compatible port.
A Mac startup disk requires either of these file system formats. You can use Disk Utility to select your storage device and see which format it's using. You can also use Disk Utility to erase it using either format.
APFS format is recommended for macOS High Sierra or later, especially if your storage device is a solid-state drive (SSD).
Mac OS Extended (Journaled) format, also known as HFS+, is also acceptable for traditional hard drives, and it's required for macOS Sierra or earlier.
This macOS installation will be specific to your Mac model. You should not expect it to start up other Mac models.
Make sure that your storage device is plugged into the appropriate port on your Mac.
Download macOS via the App Store or a web browser. If you can't do that because your Mac can't start up from its built-in startup disk, you can install macOS from macOS Recovery instead.
When the installer asks you to choose where to install, select your external storage device before continuing. You might need to click Show All Disks first.
If you're using a Mac with the Apple T2 Security Chip, use Startup Security Utility to allow your Mac to start up (boot) from external or removable media. Learn how to use Startup Security Utility.
After installing macOS on your storage device, you can select that storage device as your startup disk. Your Mac can then start up from it instead of its built-in startup disk.
When macOS software updates or upgrades become available:
Make sure that your storage device is plugged into the appropriate port on your Mac.
Start up from your external storage device instead of your built-in startup disk.
Use Software Update to update macOS on your external storage device.
Tell us more about what's happening, and we’ll suggest what you can do next.