Skip to main content

Running Bitrise builds on AWS

Bitrise is available as an Amazon Machine Image (AMI) in the AWS Marketplace. With the Bitrise AMI, you can run Bitrise builds using your own AWS resources on AWS EC2 instances connected to a Bitrise Workspace.

When to choose the AWS option

If you need to run Bitrise builds on infrastructure that you control, we offer two options: using AWS EC2 instances or our on-premise option.

We recommend using AWS instances to run Bitrise builds if you or your company already has an AWS account to operate important infrastructure. Using an AWS instance comes with several advantages:

  • Plug and play: we provide the Amazon Machine Image (AMI) as a mobile-specific build environment, with all required tools preinstalled. No specific setup needed: you only need to configure the EC2 instance.

  • Control your environment: you can configure network and storage settings during the launch of the instance (for example, you can configure a separate subnet for your Bitrise builds) to make sure all build machines run in their own AWS environment and operate according to company security policies.

  • Security: your code base will remain entirely in your control.

    Information leaving the AWS environment

    Using certain features means leaving the AWS environment: for example, using the build cache, generating build artifacts or test results.

If you don't have an AWS account, use some other cloud provider, or already manage your own machines, we recommend checking out our on-premise runner offering.

AWS offering types

There are two basic types of Bitrise on AWS AMIs:

  • Bare metal: Your builds run directly on an AWS machine. This means that the build environment is persistent, the same way it would be on your own computer. Artifacts or cache items from a build can have an effect on subsequent builds, unless you clean up the environment.

  • Virtualized/VM-based: Just like on Bitrise, every build runs in its own virtual machine that is destroyed once the build is finished. It is powered by Bitrise’s virtualization solution that has run millions of builds on the Bitrise-managed machines built on top of Apple’s virtualization framework. Our macOS offerings, including the virtualized solution, are only available on Apple silicon machines.

Updating the AMIs

The Bitrise AMIs are constantly updated with the latest versions of the pre-installed tools. However, providing the latest Xcode and Android Studio versions in the form of AMIs are slower than on the Bitrise-managed machines, because of the AWS AMI review process. You can check out the currently available versions on the AWS stack reports.

AWS pricing for Mac dedicated hosts

For macOS instances, a dedicated host must be allocated. On-Demand EC2 Mac Dedicated Hosts have a minimum host allocation and billing duration of 24 hours. For more details, check out the official AWS documentation: Amazon EC2 Dedicated Hosts Pricing.

Bare metal Linux

The bare metal Linux AMI is available on the following AWS instance types:

  • t2.2xlarge

  • t2.xlarge

  • c5n.metal

  • c5.xlarge

  • c5.metal

  • c5.4xlarge

  • c5.2xlarge

Different instance types suit different computing needs. To find out more about the functions and capabilities of the different instance types, check out the official AWS documentation.

You can run Android emulators on the metal instance types only. The other instance types don't support the use of emulators.

Bare metal macOS

The bare metal macOS AMI is only available on Apple silicon machines, on the following instance types:

  • mac2.metal

  • mac2-m2.metal

  • mac2-m2pro.metal

Android emulators are supported on all the instance types above.

Virtualized macOS

The virtualized macOS AMI is only available on Apple silicon machines, on the following instance types:

  • mac2.metal

  • mac2-m2.metal

  • mac2-m2pro.metal

Virtualization offers an ephemeral build environment: the virtual machine is destroyed at the end of every build. This means that all builds run in a completely clean environment, and previous builds have no effect on them.

You have the option of running either one or two VMs per build. Depending on how resource intensive a build is, running two VMs can mean significant savings in hardware costs.

No Android emulation

Android emulation is not available as the Apple silicon architecture doesn't support nested virtualization.

Setting up the EC2 instance

To run Bitrise builds on an AWS EC2 instance, you need to:

  1. Configure agent pools on Bitrise: Set up an agent pool for your builds and get the token required to connect your Bitrise Workspace to your AWS EC2 instance.

  2. Subscribe to the Bitrise AMI and launch an AWS EC2 instance. You can launch either a Mac or a Linux instance. For a Mac instance, you'll need to allocate a dedicated host before launching the instance.

  3. Use the token to connect the instance to your Bitrise Workspace. This will allow the Bitrise agent to run your builds on your EC2 instances.