|
| 1 | +--- |
| 2 | +title: Install CircleCI Machine Runner on AWS Graviton2 |
| 3 | +weight: 6 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## Install CircleCI Machine Runner on AWS Graviton2 |
| 10 | + |
| 11 | +This guide provides step-by-step instructions to install and configure the **CircleCI Machine Runner** on an **AWS Graviton2 (Neoverse N1) instance**. |
| 12 | +With this setup, your self-hosted **Arm64 environment** can efficiently execute CircleCI jobs directly on the Graviton2 architecture, enabling faster builds and improved performance for ARM-based workloads. |
| 13 | + |
| 14 | + |
| 15 | +### Add CircleCI Package Repository |
| 16 | +For **Debian/Ubuntu-based systems** running on **AWS Graviton2 (Arm64)**, first add the official CircleCI repository. |
| 17 | +This ensures you can install the CircleCI Runner package directly using `apt`. |
| 18 | + |
| 19 | +```console |
| 20 | +curl -s https://packagecloud.io/install/repositories/circleci/runner/script.deb.sh?any=true | sudo bash |
| 21 | +``` |
| 22 | + |
| 23 | +- The `curl` command downloads and executes the repository setup script from CircleCI’s official package server. |
| 24 | +- It configures the repository on your system, allowing `apt` to fetch and install the CircleCI runner package. |
| 25 | +- After successful execution, the CircleCI repository will be added under `/etc/apt/sources.list.d/`. |
| 26 | + |
| 27 | +### Configure the Runner Token |
| 28 | +- Each self-hosted runner requires a unique authentication token generated from your Resource Class in the CircleCI Dashboard. |
| 29 | +- Copy the token from the CircleCI web interface. |
| 30 | +- Export the token as an environment variable and update the runner configuration file as shown: |
| 31 | + |
| 32 | +```console |
| 33 | +export RUNNER_AUTH_TOKEN="YOUR_AUTH_TOKEN" |
| 34 | +sudo sed -i "s/<< AUTH_TOKEN >>/$RUNNER_AUTH_TOKEN/g" /etc/circleci-runner/circleci-runner-config.yaml |
| 35 | +``` |
| 36 | + |
| 37 | +### Install the CircleCI Runner |
| 38 | +Install the pre-built CircleCI runner package: |
| 39 | + |
| 40 | +```console |
| 41 | +sudo apt-get install -y circleci-runner |
| 42 | +``` |
| 43 | + |
| 44 | +- Installs the latest CircleCI Machine Runner compatible with your Arm64 instance. |
| 45 | +- Runner binary and configuration files are located in `/usr/bin/` and `/etc/circleci-runner/`. |
| 46 | + |
| 47 | +### Configure the Runner Authentication Token |
| 48 | +Update the CircleCI runner configuration with your authentication token. This token is generated from the Resource Class you created in the CircleCI Dashboard. |
| 49 | + |
| 50 | +```console |
| 51 | +export RUNNER_AUTH_TOKEN="YOUR_AUTH_TOKEN" |
| 52 | +sudo sed -i "s/<< AUTH_TOKEN >>/$RUNNER_AUTH_TOKEN/g" /etc/circleci-runner/circleci-runner-config.yaml |
| 53 | +``` |
| 54 | + |
| 55 | +### Enable and Start the CircleCI Runner |
| 56 | +Set the CircleCI runner service to start automatically and verify it is running: |
| 57 | + |
| 58 | +```console |
| 59 | +sudo systemctl enable circleci-runner |
| 60 | +sudo systemctl start circleci-runner |
| 61 | +sudo systemctl status circleci-runner |
| 62 | +``` |
| 63 | + |
| 64 | +If the status shows active (running), your runner is successfully installed and connected to CircleCI. |
| 65 | + |
| 66 | +```output |
| 67 | +● circleci-runner.service - Run the CircleCI self-hosted runner agent |
| 68 | + Loaded: loaded (/usr/lib/systemd/system/circleci-runner.service; enabled; preset: enabled) |
| 69 | + Active: active (running) since Fri 2025-10-17 05:33:20 UTC; 51min ago |
| 70 | + Main PID: 2226 (circleci-runner) |
| 71 | + Tasks: 9 (limit: 18717) |
| 72 | + Memory: 53.0M (peak: 66.9M) |
| 73 | + CPU: 1.249s |
| 74 | + CGroup: /system.slice/circleci-runner.service |
| 75 | + └─2226 /usr/bin/circleci-runner machine -c /etc/circleci-runner/circleci-runner-config.yaml |
| 76 | +
|
| 77 | +Oct 17 05:41:28 ip-172-31-34-224 circleci-runner[2226]: 05:41:28 7b67e 24.210ms worker loop: claim: app.backoff_ms=5000 app.> |
| 78 | +Oct 17 06:00:08 ip-172-31-34-224 circleci-runner[2226]: 06:00:08 a8093 22.942ms POST /api/v3/runner/claim app.loop_name=claim> |
| 79 | +Oct 17 06:00:08 ip-172-31-34-224 circleci-runner[2226]: 06:00:08 a8093 23.028ms claim app.loop_name=claim: mode=agent result> |
| 80 | +Oct 17 06:00:08 ip-172-31-34-224 circleci-runner[2226]: 06:00:08 a8093 23.064ms worker loop: claim: app.backoff_ms=5000 app.> |
| 81 | +Oct 17 06:04:49 ip-172-31-34-224 circleci-runner[2226]: 06:04:49 73039 19.847ms POST /api/v3/runner/claim app.loop_name=claim> |
| 82 | +Oct 17 06:04:49 ip-172-31-34-224 circleci-runner[2226]: 06:04:49 73039 19.936ms claim app.loop_name=claim: mode=agent result> |
| 83 | +Oct 17 06:04:49 ip-172-31-34-224 circleci-runner[2226]: 06:04:49 73039 19.971ms worker loop: claim: app.backoff_ms=5000 app.> |
| 84 | +Oct 17 06:19:13 ip-172-31-34-224 circleci-runner[2226]: 06:19:13 c34c1 22.392ms POST /api/v3/runner/claim app.loop_name=claim> |
| 85 | +Oct 17 06:19:13 ip-172-31-34-224 circleci-runner[2226]: 06:19:13 c34c1 22.479ms claim app.loop_name=claim: mode=agent result> |
| 86 | +Oct 17 06:19:13 ip-172-31-34-224 circleci-runner[2226]: 06:19:13 c34c1 22.514ms worker loop: claim: app.backoff_ms=5000 app.> |
| 87 | +``` |
| 88 | + |
| 89 | +This confirms that the CircleCI Runner is actively connected to your CircleCI account and ready to accept jobs. |
| 90 | + |
| 91 | +Also, you can verify it from the dashboard: |
| 92 | + |
| 93 | + |
0 commit comments