---
title: Hosting your own GitHub runner on an Instance
description: In this tutorial, you will learn how to host your own GitHub runner on an Instance
tags: Github-runner github
products:
  - instances
dates:
  validation: 2025-04-08
  posted: 2018-04-06
  validation_frequency: 12
difficulty: beginner
usecase:
  - application-hosting
ecosystem:
  - third-party
---
import image from './assets/scaleway-github-actions-menu.webp'
import image2 from './assets/scaleway-github-settings-menu.webp'
import image3 from './assets/scaleway-add-github-runner.webp'
import image4 from './assets/scaleway-github-runner-active.webp'

import Requirements from '@macros/iam/requirements.mdx'


GitHub Actions stands as a versatile tool, simplifying the automation of all your software workflows. This integrated CI/CD solution handles an extensive array of tasks tied to your repository.

GitHub offers a limited range of complementary resources for constructing applications through GitHub Actions; however, proficient developers can swiftly encounter these constraints. Teams engaged in professional-grade projects might also want full authority over their build environment. GitHub extends the option to use runners on self-managed instances. A runner function is an application executing tasks from a GitHub Actions workflow.

In this guide, you will learn how to configure a GitHub Actions runner on a Scaleway Instance, effectively streamlining your project workflows. For typical workloads, opting for a [General Purpose Instance with shared resources](/instances/reference-content/choosing-instance-type/) is recommended. For resource-intensive workloads, the use of General Purpose Instances with dedicated resources provides enhanced performance.

<Message type="tip">
  We recommend you follow this tutorial using a [General Purpose Instance](/instances/reference-content/general-purpose/).
</Message>

<Requirements />

- A Scaleway account logged into the [console](https://console.scaleway.com)
- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization
- An [SSH key](/organizations-and-projects/how-to/create-ssh-key/)
- An [Instance](/instances/how-to/create-an-instance/) running on Ubuntu 20.04
- A [GitHub](https://www.github.com) account
- `sudo` privileges or access to the root user

## Adding a workflow to your repository

1. Log into your [GitHub](https://github.com) account and select the repository in which you want to add GitHub Actions.
2. Click the **Actions** tab in your repository. A list of available workflows for your project displays.
    <Lightbox image={image} alt="" />
3. Select the workflow that corresponds to your project and click **Set up this workflow**. You can either create a workflow from scratch or use one of the templates suggested.
4. Edit the workflow according to your requirements. For more information about GitHub Actions, refer to the [product documentation](https://docs.github.com/en/actions). Once configured, save the workflow.

## Installing a GitHub runner

1. [Connect to your Instance](/instances/how-to/connect-to-instance/) via SSH.
2. Create a user for the GitHub runner.
    ```s
    adduser ghrunner
    ```
3. Add the user to the superuser file:
    ```s
    adduser ghrunner sudo
    ```
4. Switch into the `ghrunner` user account:
    ```s
    su ghrunner
    ```
5. Download and unpack the GitHub runner using the following commands:
    ```s
    # Create a folder
    mkdir actions-runner && cd actions-runner
    # Download the latest runner package
    curl -O -L https://github.com/actions/runner/releases/download/v2.315.0/actions-runner-linux-x64-2.323.0.tar.gz
    # Extract the installer
    tar xzf ./actions-runner-linux-x64-2.323.0.tar.gz
    ```
    <Message type="tip">
      You may check the GitHub runner repository for the [latest release of the runner](https://github.com/actions/runner/releases/latest).
    </Message>

## Adding the runner to your GitHub repository

1. Go back to your GitHub repository and click the **Settings** tab. Then click **Actions** in the side menu.
    <Lightbox image={image2} alt="" />
2. Click **Runners** in the Actions section of the side menu. The external runners' overview page displays.
3. Click **Add runner**.
    <Lightbox image={image3} alt="" />
4. The runners' configuration instruction displays. Select the OS type of your OS (Linux, X64) and scroll down to the **Configure** section of the page.
5. Copy the configuration information displayed and execute the `config.sh` on your Instance:
    ```s
    ./config.sh --url https://github.com/scaleway-community/my-project --token AC6XRSJUUEWXLYJ7SQ6WMVLASKYWZ
    ```
    <Message type="note">
      If you run the `config.sh` script without flags, you must provide the repository URL and token during the configuration.
    </Message>

    The configuration tool connects to GitHub using the given token.
6. Enter the name of the runner during the runner configuration. Several tags are automatically attached to it. Optionally, you can enter custom tags. When prompted, enter the `work` directory of the runner. You can confirm the default values by pressing enter. Otherwise, enter your customized values before pressing enter.
7. The runner is configured. Once everything is ready, the following message displays:
    ```s
    √ Runner successfully added
    √ Runner connection is good
    [...]
    √ Settings Saved.
    ```
8. Launch the runner using the following command:
    ```s
    ./run.sh
    ```

Your self-hosted GitHub runner is now ready and you can check its status from the Runners section of your GitHub repository:
<Lightbox image={image4} alt="" />

To run your CI/CD tasks on your self-hosted runner, add this YAML in your workflow file for each job:
```yaml
runs-on: self-hosted
```

For more information about GitHub runners, refer to the [official documentation](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners).