Go to the AWS EC2 dashboard in your AWS account. Select a region where EC2 instances are available, as at the time of writing, they are not available in all regions.You can see in this image that I have selected us-east-2 (by its display name, Ohio) top right of the window. Click the Launch Instance button.
Select the AMI with the preferred OSX operating system version. The newest looks good to me here.
Then select the instance type. Because I selected an OSX operating system, only mac1 family instances are available here. Proceed to the next step.
Mac instances require to be run on a dedicated host. In other words, you get the actual hardware for your instance. In the data center, mac1.metal are essentially Mac Mini hardware, racked onto Nitro hypervisor/virtualization chips. Let's therefore allocate a dedicated host. A new browser tab will open for this. Don't close the old tab as we will go back to it.
Fill the fields for name, instance family, instance type, availability zone, and quantity. Proceed to allocate.
If the operation fails, it may be that there is insufficient availability in the selected availability zone, so try another until the operation succeeds.
After successful creation of the host, return to the previous tab to continue launching. You can close the dedicated host tab if you like. Refresh the list of hosts as shown.
Open the host drop-down and select the dedicated host that you just created.
I didn't need to change any other settings. Proceed to add storage.
Select the amount of EBS storage for the root volume. I need to install a bunch of big applications for development on my instance, so I selected a large root volume, however your needs may be different, and you are billed for the quantity of EBS that you use. It is actually possible to take a snapshot of this root volume later, restore it to a larger volume, and replace the volume with a larger one without replacing the instance, however it's better to have a large enough volume to begin with. To be precise the time to do this replacement is probably more expensive than having a generously sized volume for the life of the instance.
Choose gp3 storage under most circumstances. It's faster than gp2 or magnetic storage, and actually 20% (at time of writing) cheaper than gp2.
Proceed to review and launch.
You will notice that the security group has no rule to allow SSH. That's okay for most production instances. Only open an SSH port if you want to make a connection, and don't forget to close it afterwards.
Launch the instance if everything looks good.
You will need a key pair to access the instance. In my case here, I create a new key pair.
Give it a name, and download it.
Save the file that is downloaded somewhere safe where you can find it.
(Note that this is a pretty informal method. The keypair file contains a cryptographic private key. There are stricter guidelines around creation and use of SSH keys if your circumstances dictate it.)
Once you have secured your keypair file Launch Instances
.
The launch status popup appears. Use the link to see the instances screen.
The instance will take a moment to get into the running state, and you will be able to see the public DNS for the instance. The little copy icon allows the string to be easily copied to the clipboard.
When you terminate the instance, don't forget to delete the dedicated host, as you are billed for the host, not the instance, so you don't want unused dedicated hosts just sitting around.
Connect to the mac1.metal instance using SSH. My other gist covers this procedure.
You can connect to the mac1.metal instance using its public IP address, by setting up screen sharing and opening the port on the security group. This is not advised however, as the connection is unencrypted. It is better to tunnel the VNC connection over SSH to secure it.
The procedure is documented in the official documentation here.
This YouTube video also has some information: https://www.youtube.com/watch?v=FtU2_bBfSgM