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. This is lesson 2 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.
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:
- Generate a unique registration token from GitHub.
- Download and extract the runner application onto your machine.
- Configure the runner with your GitHub repository/organization URL and the token.
- 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.gzStep 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,productionStep 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.shUsing 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.
Learn DevOps Bootcamp with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 142
- Lessons
- 568
Frequently Asked Questions
Is the “Self-Hosted Runners for On-Premise” lesson free?
Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Self-Hosted Runners for On-Premise”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.
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, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.
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
- Developing Custom GitHub Actions
- Self-Hosted Runners for On-Premise
- Integrating with Enterprise Systems
- Composite Actions and Publishing to the Marketplace