ThisCalculator

Everyday

Bare Metal Cloud GitHub Actions: Setup & Use

Updated · Standard formula, shown below

Total runner-minutes 120 min
Est. cost at $0.10/min
12.00 USD
Result
Job time
30 min
You entered
Concurrent jobs
4 count
You entered

Bare metal cloud GitHub Actions lets you run CI/CD jobs on dedicated physical servers instead of shared virtual machines, giving you full control over hardware, performance, and isolation. You connect a bare metal provider to GitHub Actions via self-hosted runners, then use labels to route specific jobs to those machines. This article explains how it works, when it makes sense, and how to set it up safely.

Formula

The calculator estimates total runner-minutes and cost for a self-hosted runner fleet. Total runner-minutes = job time (minutes) × number of concurrent jobs. Estimated cost = total runner-minutes × price per minute (default $0.10, adjust to your provider’s rate).

Variables: t = job time in minutes, c = concurrent jobs, price = cost per minute in USD.

Worked Example

Default: t = 30 min, c = 4. Total = 30 × 4 = 120 runner-minutes. Cost = 120 × 0.10 = $12.00. So four 30-minute jobs cost $12 at $0.10/min.

What Is Bare Metal Cloud?

Bare metal cloud refers to on-demand physical servers rented from a provider like Equinix Metal, Hetzner, or OVHcloud. Unlike virtual machines (VMs), you get the entire server—CPU, RAM, storage, and network—without a hypervisor layer. This means no noisy neighbors, predictable performance, and access to hardware features like GPUs or NVMe drives.

GitHub Actions normally runs on GitHub-hosted runners (virtual machines) that are ephemeral and auto-scaling. A self-hosted runner is a program you install on your own machine (physical or virtual) that connects to GitHub and executes jobs. When you use bare metal for that runner, you combine the flexibility of self-hosting with the raw power of dedicated hardware.

Why Use Bare Metal for GitHub Actions?

Most CI/CD workloads run fine on GitHub-hosted runners, but some scenarios demand more:

  • Performance: Builds that need high CPU, large memory, or GPU acceleration (e.g., machine learning training, game builds) can be 2-5x faster on bare metal.
  • Stability: VMs on shared hosts can suffer from resource contention. Bare metal gives consistent performance.
  • Custom hardware: Need a specific CPU architecture (ARM, AMD), a GPU, or a large NVMe disk? Bare metal lets you choose.
  • Security/compliance: Some organizations require dedicated hardware for sensitive code or regulated workloads.
  • Cost at scale: If you run hundreds of jobs daily, per-minute pricing on GitHub-hosted runners can exceed the cost of a few dedicated servers.

However, you take on maintenance: OS updates, security patches, and runner software updates are your responsibility.

How to Set Up a Bare Metal Runner

Setting up a bare metal runner involves three main steps: provisioning the server, installing the runner, and configuring it for your repository or organization.

  1. Provision a bare metal server from a provider. Choose a location close to your team, pick an OS (Ubuntu 22.04 LTS is common), and ensure it has sufficient resources for your builds.
  2. Install the runner software on the server. Download the latest runner package from GitHub’s repository, create a dedicated user account (e.g., github-runner), and run the config.sh script with a registration token from your repository or organization settings.
  3. Add labels to the runner (e.g., bare-metal, linux, x64) during configuration. These labels let you target specific jobs.
  4. Start the runner using ./run.sh or install it as a service with sudo ./svc.sh install and sudo ./svc.sh start.
  5. Update your workflow file to use runs-on: [self-hosted, bare-metal] (or your custom labels) for jobs that should run on that machine.

Test with a simple job first to confirm connectivity and permissions.

Common Problems and Solutions

Self-hosted runners on bare metal can hit issues that GitHub-hosted runners don’t:

  • Runner offline: Check the network, firewall, and that the runner service is running. Look at the logs in _diag folder.
  • Jobs stuck in queue: Ensure the runner has the right labels and is not already busy with another job. You can run multiple runners on one server by creating separate directories.
  • Security risks: Anyone with push access to the repository can execute code on the runner. Use private repositories and restrict who can register runners.
  • Dirty environment: Unlike ephemeral GitHub runners, bare metal runners persist state between jobs. Clean up build artifacts and caches in your workflow.
  • Scaling: Manual provisioning is slow. Use auto-scaling scripts or tools like actions-runner-controller (for Kubernetes) to spin up runners on demand.

Cost Comparison: Bare Metal vs. GitHub-Hosted

GitHub-hosted runners charge per minute (e.g., Linux 2-core ~$0.008/min, 8-core ~$0.032/min). A bare metal server with 32 cores might cost $0.50/hour ($0.0083/min) but you pay for idle time. For continuous heavy usage, bare metal is often cheaper; for sporadic jobs, GitHub-hosted is better.

Example: 10,000 minutes/month on GitHub 8-core = $320. A dedicated 32-core server at $200/month gives you 44,640 minutes (31 days × 24h × 60min), but you only benefit if you use it.

Also consider network egress fees (often free on GitHub, but metered on some bare metal providers) and storage costs.

Security Best Practices

Running self-hosted runners on bare metal introduces security responsibilities:

  • Use dedicated accounts with minimal privileges. Don’t run runners as root.
  • Keep the OS and runner software updated regularly.
  • Isolate runners from other production systems using VLANs or separate networks.
  • Use GitHub’s environment protection rules (e.g., required reviewers) for sensitive jobs.
  • Consider ephemeral runners (using containerization or VM snapshots) to avoid state leakage between jobs.
  • Monitor runner logs for unusual activity.

For public repositories, be extremely cautious—anyone can open a PR that runs code on your runner. GitHub recommends using self-hosted runners only with private repositories.

Alternatives to Bare Metal

If bare metal seems like too much work, consider these alternatives:

  • GitHub-hosted larger runners: Pay for more CPU/RAM/GPU without managing hardware.
  • Self-hosted on VMs: Use cloud VMs (AWS EC2, Azure VM) as runners—easier to provision and scale, but still self-managed.
  • Kubernetes with actions-runner-controller: Dynamically scale runners as pods on your cluster.
  • Other CI providers: Some offer bare metal runners as a service (e.g., Cirrus CI, Buildkite) with per-second billing.

Frequently Asked Questions

Is bare metal faster than GitHub-hosted runners?

Often yes, for CPU-intensive or I/O-heavy workloads. Bare metal gives you dedicated resources without virtualization overhead. However, network latency and OS configuration can offset gains. Benchmark your specific build to know for sure.

Can I use a GPU on a bare metal runner?

Yes, if your provider offers GPU servers. You’ll need to install the appropriate GPU drivers and CUDA toolkit on the runner. GitHub-hosted runners currently don’t offer GPU options.

How do I auto-scale bare metal runners?

You can write scripts that provision servers via the provider’s API when the queue length exceeds a threshold. Tools like actions-runner-controller (for Kubernetes) can also scale runners dynamically, but you’d need a Kubernetes cluster.

What are the security risks of self-hosted runners?

The main risk is that any user with push access to the repository can execute arbitrary code on the runner. If the runner has access to secrets or other systems, that’s a risk. Mitigate by using private repos, least-privilege accounts, and ephemeral runners.

Do I need to pay GitHub for self-hosted runners?

No, self-hosted runners are free. You only pay for the infrastructure you use (the bare metal server). However, you lose the free minutes that come with GitHub-hosted runners.

Can I mix bare metal and GitHub-hosted runners in one workflow?

Yes. Use labels to route different jobs to different runner types. For example, a job with runs-on: ubuntu-latest uses GitHub-hosted, while another with runs-on: [self-hosted, bare-metal] uses your server.

Related

Formula used
in t | Job time | min | 30 | 0
in c | Concurrent jobs | count | 4 | 1
out total | Total runner-minutes | min | t * c | 0
out cost | Est. cost at $0.10/min | USD | (t * c) * 0.10 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.