# Set up a GitHub Self-Hosted Runner

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/)
- [About Google Axion and GitHub Actions](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/background/)
- [Create the instance](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/instance/)
- [Set up a GitHub Self-Hosted Runner](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/deploy/)
- [Deploy NGINX with the GitHub runner](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/nginx-deployment/)
- [Next Steps](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/_next-steps/)

## Overview
This section shows you how to deploy a GitHub Actions self-hosted runner on your Arm64 Google Axion C4A instance. You will install Git and GitHub CLI, authenticate with GitHub, and register the runner so CI/CD workflows run on Arm infrastructure.

## Set up your development environment
Start by installing the required dependencies using the `apt` package manager:

```bash
sudo apt update
sudo apt install -y git gh vim
```

Configure your Git identity:

```bash
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
```

Now you are ready to connect the machine to GitHub. The command below is used to authenticate the GitHub CLI with your GitHub account. It allows you to securely log in using a web browser or token, enabling the CLI to interact with repositories, actions, and other GitHub features on your behalf.

Authenticate with GitHub:

```bash
gh auth login
```

Follow the prompts and accept the defaults:

![Screenshot of GitHub authentication prompt](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/./images/gh-auth.png "Screenshot of GitHub authentication prompt")

> If you get an error opening the browser on your virtual machine, you can navigate to the following URL on the host machine and enter the device code displayed in the CLI of the virtual machine:

```bash
https://github.com/login/device
```

When authentication succeeds, you will see a confirmation screen in your browser:

![Screenshot of successful GitHub login confirmation](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/./images/login-page.png "Screenshot of successful GitHub login confirmation")

## Test GitHub CLI and Git
The command below creates a new public GitHub repository named `test-repo` using the GitHub CLI. It sets the repository visibility to public, meaning that anyone can view it:

```bash
gh repo create test-repo --public
```

You should see an output similar to:

```
__output__✓ Created repository <your-github-account>/test-repo on GitHub
__output__https://github.com/<your-github-account>/test-repo
```

## Configure the self-hosted runner
In your repository, go to **Settings** → **Actions** → **Runners** and select **Add runner**, or view existing self-hosted runners.

> If the **Actions** tab is not visible, enable Actions under **Settings** → **Actions** → **General** by selecting **Allow all actions and reusable workflows**.

![Screenshot of repository Runners settings page](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/./images/newsh-runner.png "Screenshot of repository Runners settings page")

Click **New self-hosted runner**. In the setup panel, choose `Linux` as the operating system and `ARM64` as the architecture. Copy the generated setup commands and run them on your C4A VM.

![Screenshot of the Add new self-hosted runner panel](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/./images/new-runner.png "Screenshot of the Add new self-hosted runner panel")

The final command links the runner to your GitHub repository using a one-time registration token. During setup, you will be prompted for the runner group, runner name, and work folder. Press **Enter** at each prompt to accept the defaults. The output should look similar to:

```
__output__--------------------------------------------------------------------------------
__output__|        ____ _ _   _   _       _          _        _   _                      |
__output__|       / ___(_) |_| | | |_   _| |__      / \   ___| |_(_) ___  _ __  ___      |
__output__|      | |  _| | __| |_| | | | | '_ \    / _ \ / __| __| |/ _ \| '_ \/ __|     |
__output__|      | |_| | | |_|  _  | |_| | |_) |  / ___ \ (__| |_| | (_) | | | \__ \     |
__output__|       \____|_|\__|_| |_|\__,_|_.__/  /_/   \_\___|\__|_|\___/|_| |_|___/     |
__output__|                                                                              |
__output__|                       Self-hosted runner registration                        |
__output__|                                                                              |
__output__--------------------------------------------------------------------------------
__output__# Authentication
__output__√ Connected to GitHub
__output__# Runner Registration
__output__Enter the name of the runner group to add this runner to: [press Enter for Default]
__output__Enter the name of runner: [press Enter for lpprojectubuntuarm64]
__output__This runner will have the following labels: 'self-hosted', 'Linux', 'ARM64'
__output__Enter any additional labels (ex. label-1,label-2): [press Enter to skip]
__output__√ Runner successfully added
__output__√ Runner connection is good
```

Finally, start the runner by executing:

```bash
./run.sh
```

You should see an output similar to:

```
__output__√ Connected to GitHub
__output__Current runner version: '2.326.0'
__output__2025-07-15 05:51:13Z: Listening for Jobs
```

The runner will now be visible in the GitHub actions:

![Screenshot of runner visible in GitHub](https://learn.arm.com/learning-paths/servers-and-cloud-computing/github-on-arm/./images/final-runner.png "Screenshot of runner visible in GitHub")

For now, you can terminate the `./run.sh` command with `Ctrl+C`. Move on to the next section to set up a simple web server using the runner.
