Self-hosted runners
This document describes how to set up a self-hosted GitHub Actions runner on Ubuntu Linux to run kickstart workflows.
Overview
Section titled “Overview”Self-hosted runners let you run GitHub Actions on your own infrastructure. Useful for:
- Workflows that need specific hardware or software
- Reducing cost for compute-heavy workflows
- Controlling the execution environment
- Access to private resources
Prerequisites
Section titled “Prerequisites”- Ubuntu Linux (20.04 LTS or later recommended)
- Root or sudo access
- Network access to GitHub
- At least 2GB RAM and 10GB disk
Installation steps
Section titled “Installation steps”1. Create runner user (recommended)
Section titled “1. Create runner user (recommended)”sudo useradd -m -s /bin/bash github-runnersudo su - github-runner2. Download and configure runner
Section titled “2. Download and configure runner”mkdir actions-runner && cd actions-runner
# Download latest runner (check https://github.com/actions/runner/releases for version)curl -o actions-runner-linux-x64-2.311.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.311.0/actions-runner-linux-x64-2.311.0.tar.gz
tar xzf ./actions-runner-linux-x64-2.311.0.tar.gz3. Configure runner
Section titled “3. Configure runner”# Repository-level./config.sh --url https://github.com/OWNER/REPO --token RUNNER_TOKEN
# Organization-level./config.sh --url https://github.com/OWNER --token RUNNER_TOKENReplace OWNER, REPO, and RUNNER_TOKEN (from GitHub: Settings → Actions →
Runners → New self-hosted runner).
4. Install runner service
Section titled “4. Install runner service”sudo ./svc.sh installsudo ./svc.sh startsudo ./svc.sh status5. Install required dependencies
Section titled “5. Install required dependencies”Kickstart workflows need Deno, opencode (and/or Cursor CLI), and Git:
# Denocurl -fsSL https://deno.land/install.sh | shecho 'export DENO_INSTALL="$HOME/.deno"' >> ~/.bashrcecho 'export PATH="$DENO_INSTALL/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# opencode (opencode workflow)curl -fsSL https://opencode.dev/install | bashecho 'export PATH="$HOME/.opencode/bin:$PATH"' >> ~/.bashrc
# Cursor CLI (Cursor workflow)curl https://cursor.com/install -fsS | bashecho 'export PATH="$HOME/.cursor/bin:$PATH"' >> ~/.bashrc
# Gitsudo apt-get updatesudo apt-get install -y gitsource ~/.bashrc6. Configure environment variables
Section titled “6. Configure environment variables”Add to ~/.bashrc or a ~/.env file:
export GITHUB_TOKEN="your-token-here" # Or use GitHub Actions secretsFor the systemd service, create an override (e.g.
/etc/systemd/system/actions.runner.*.service.d/override.conf):
[Service]Environment="GITHUB_TOKEN=your-token-here"Environment="PATH=/home/github-runner/.deno/bin:/home/github-runner/.opencode/bin:/home/github-runner/.cursor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"Then:
sudo systemctl daemon-reloadsudo systemctl restart actions.runner.*.serviceSecurity
Section titled “Security”- Network: Restrict outbound HTTPS to
github.comandapi.github.com; consider VPN or isolated segment. - Access: Use a dedicated user with minimal privileges; restrict runner directories; store tokens securely and rotate.
- Runner: Enable auto-updates; monitor logs; clean workspace directories regularly.
Configuration
Section titled “Configuration”Labels: e.g. ./config.sh ... --labels self-hosted,linux,ubuntu
Workflow: Use runs-on: self-hosted (or a specific label) in your job.
Maintenance
Section titled “Maintenance”Update: Runner can auto-update; or stop, download a new package, extract, and start again.
Monitor: sudo systemctl status actions.runner.*.service; logs:
sudo journalctl -u actions.runner.*.service -f and
~/actions-runner/_diag/Runner_*.log.
Cleanup: e.g. cron:
0 2 * * * find ~/actions-runner/_work -type d -mtime +7 -exec rm -rf {} +
Troubleshooting
Section titled “Troubleshooting”- Not connecting: Check network (
curl https://github.com), token, firewall, runner logs. - Dependencies not found: Verify PATH and env vars; restart service; test
deno --version,opencode --version. - Permission issues: Check runner user permissions, ownership of
~/actions-runner, writable workspace.