0Pricing
DevOps Bootcamp · Lesson

Self-Hosted Runners for On-Premise

Configure and manage self-hosted runners to execute workflows in your own environment for specific hardware or security requirements.

Self-Hosted Runners for On-Premise is a free DevOps Bootcamp lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Intro to Self-Hosted Runners

Welcome to the world of self-hosted runners! These are powerful tools that allow you to run GitHub Actions workflows on your own machines.

Instead of using GitHub's cloud-based runners, you can bring your own hardware, operating system, and network environment to execute your CI/CD jobs.

Why Use Self-Hosted Runners?

While GitHub-hosted runners are convenient, self-hosted runners offer unique advantages:

  • Specific Hardware: Use custom hardware, like GPUs or specific CPU architectures.
  • Network Access: Connect directly to private networks and resources (databases, internal services).
  • Security: Keep sensitive build environments within your own controlled infrastructure.
  • Cost Optimization: Potentially reduce costs for high-volume usage by leveraging existing infrastructure.

Runner Machine Requirements

To set up a self-hosted runner, your machine needs to meet a few basic requirements:

  • Operating System: Linux, Windows, or macOS are supported.
  • Network Access: The runner machine must be able to communicate with GitHub.com (or GitHub Enterprise Server).
  • Resources: Sufficient CPU, RAM, and disk space to handle your workflow jobs.
  • Software: Any tools or SDKs required by your workflows must be installed on the runner.

The Setup Process Overview

Setting up a self-hosted runner involves a few key steps. It's like preparing your machine to become a dedicated worker for your GitHub Actions:

  1. Generate a unique registration token from GitHub.
  2. Download and extract the runner application onto your machine.
  3. Configure the runner with your GitHub repository/organization URL and the token.
  4. Start the runner application to listen for jobs.

Step 1: Get Your Runner Token

First, you need to tell GitHub you're setting up a new runner. This requires a unique token.

Navigate to your repository or organization settings on GitHub.com:

  • For a repository: Settings > Actions > Runners > New self-hosted runner
  • For an organization: Settings > Actions > Runners > New self-hosted runner

Follow the prompts to generate a token. This token is used only for registration.

Step 2: Download the Runner App

Next, download the runner application to your chosen machine. The GitHub UI will provide specific commands for your OS.

For example, on a Linux machine, you might use:

mkdir actions-runner
cd actions-runner
curl -o actions-runner-linux-x64-2.309.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.309.0/actions-runner-linux-x64-2.309.0.tar.gz
tar xzf ./actions-runner-linux-x64-2.309.0.tar.gz

Step 3: Configure the Runner

After extracting, you'll configure the runner. This links it to your GitHub repository or organization and allows you to set labels.

Run the config.sh (Linux/macOS) or config.cmd (Windows) script. You'll provide the GitHub URL and the token you generated earlier.

./config.sh --url https://github.com/your-org/your-repo --token YOUR_TOKEN --labels my-linux-runner,production

Step 4: Start the Runner

Once configured, you can start the runner application. It will then connect to GitHub and wait for jobs.

Simply run ./run.sh (Linux/macOS) or run.cmd (Windows). For production environments, it's recommended to install the runner as a service so it starts automatically.

./run.sh

Using Runners in Workflows

To use your self-hosted runner, specify it in your workflow YAML file using the runs-on keyword. You can use self-hosted or specific labels you assigned during configuration.

name: My Self-Hosted Workflow
on: [push]
jobs:
  build:
    runs-on: [self-hosted, my-linux-runner]
    steps:
      - uses: actions/checkout@v4
      - run: echo "Hello from my custom runner!"

Quick Check: Runner Benefits

Self-hosted runners offer unique advantages over GitHub-hosted runners. Which of the following is a primary benefit of using a self-hosted runner?

Recap: Self-Hosted Runners

You've learned about self-hosted runners! These allow you to execute GitHub Actions workflows on your own infrastructure, providing control over hardware, network access, and security.

We covered the setup process: generating a token, downloading the app, configuring, and starting the runner. You also saw how to target your custom runners in your workflow YAML files using runs-on.

Frequently asked questions

Is the “Self-Hosted Runners for On-Premise” lesson free?

Yes — the full text of “Self-Hosted Runners for On-Premise” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.

What will I learn in “Self-Hosted Runners for On-Premise”?

Configure and manage self-hosted runners to execute workflows in your own environment for specific hardware or security requirements. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start DevOps Bootcamp?

No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Self-Hosted Runners for On-Premise” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this DevOps Bootcamp lesson?

Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Developing Custom GitHub Actions
  2. Self-Hosted Runners for On-Premise
  3. Integrating with Enterprise Systems
  4. Composite Actions and Publishing to the Marketplace
← Back to DevOps Bootcamp