Skip to content


Setup self-hosted GitHub runner

Learn how to setup self-hosted GitHub runner (Windows and Linux) by yourself.

With self-hosted runners, you can create custom hardware configurations that meet your needs with processing power or memory to run larger jobs, install software available on your local network, and choose an operating system not offered by GitHub-hosted runners. — GitHub

Setup Runner

  1. Go to your repository in GitHub.

  2. In Settings > Actions > Runners, click on New self-hosted runner button. img1

  3. Choose Runner Image and Architecture. Do take note that, the architecture is based on your device specifications. For my case is x64. img2

  4. Download the necessary files. You can find all these commands on the same page where you select Runner Image and Architecture.

    Windows Runner
    # Create a folder under the drive root
    mkdir actions-runner; cd actions-runner
    # Download the latest runner installer file
    Invoke-WebRequest -Uri -OutFile
    # Extract the installer
    Add-Type -AssemblyName System.IO.Compression.FileSystem ; [System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD/", "$PWD")
    Linux Runner
    # Create a folderr under drive root
    mkdir actions-runner && cd actions-runner
    # Download the latest runner installer file
    curl -o actions-runner-linux-x64-2.311.0.tar.gz -L
    # Extract the installer
    tar xzf ./actions-runner-linux-x64-2.311.0.tar.gz

    Here is the output after executing all these commands. img3

  5. Configure and start the runner.

    Windows Runner
    # Configure the runner
    ./config.cmd --url <github-repo-url> --token <token> --labels <lists-of-label>
    # Start the runner
    Linux Runner
    # Configure the runner
    ./ --url <github-repo-url> --token <token> --labels <lists-of-label>
    # Start the runner

    Programmatically assign labels to a self-hosted runner is optional. Here is the sample configuration of the runner.

    Verify your runner being setup. img5

  6. Using your self-hosted runner. Create a new file under .github/workflows/test.yaml.

    name: Test runner
          runs-on: ["self-hosted"]
          - name: Checkout repository
             uses: actions/checkout@v4
          - name: list directory
             run: ls

    Here is the output after all the CI jobs are completed. img6

  7. Optional: You can configure the self-hosted runner application as a service