GitHub Actions self-hosted runners let you run CI/CD workflows on your own infrastructure, giving you more control over hardware, software, and networking. This guide registers a self-hosted runner on Ubuntu 24.04 LTS.
Tested and valid on:
- Ubuntu 24.04 LTS
Prerequisites
- Ubuntu 24.04 LTS server
- A GitHub account and repository
- A user with sudo privileges
Step 1 – Get the Runner Registration Token
In your GitHub repository, go to Settings → Actions → Runners → New self-hosted runner. Select Linux x64 and copy the registration token.
Step 2 – Create a Runner User
Run the agent as a dedicated non-root user:
sudo useradd -m -s /bin/bash github-runner
sudo usermod -aG docker github-runner # if Docker is needed
Step 3 – Download the Runner Package
Switch to the runner user and download:
sudo -u github-runner bash
cd ~
mkdir actions-runner && cd actions-runner
curl -o actions-runner-linux-x64.tar.gz -L https://github.com/actions/runner/releases/latest/download/actions-runner-linux-x64-2.317.0.tar.gz
tar xzf actions-runner-linux-x64.tar.gz
Step 4 – Configure the Runner
Run the configuration script:
./config.sh --url https://github.com/your_org/your_repo --token YOUR_TOKEN
Accept the defaults or customise labels and runner group.
Step 5 – Install as a Systemd Service
Exit the runner user session and install as a service:
exit
sudo /home/github-runner/actions-runner/svc.sh install github-runner
sudo /home/github-runner/actions-runner/svc.sh start
Step 6 – Verify the Runner is Online
Check GitHub: go to Settings → Actions → Runners. The runner should show as Idle.
Step 7 – Use the Runner in a Workflow
Reference the runner in your workflow YAML:
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Run tests
run: npm test
Conclusion
Your GitHub Actions self-hosted runner is now active on Ubuntu 24.04 LTS. Workflows targeting runs-on: self-hosted will execute on your server, giving you full control over the build environment.