Skip to content

Requirements for self hosted runners

Shivam Mathur edited this page Feb 5, 2024 · 19 revisions

Note: This guide is for using self-hosted runners without docker. To set up a docker container with a self-hosted runner follow this guide.


To set up a self-hosted runner for setup-php, make sure the following requirements are met on your system.

Linux/WSL

  • Ubuntu 20.04 (focal) and Ubuntu 18.04 (bionic) are supported.

  • The runner needs a user account having password-less sudo access, otherwise, you would have to enter the password on each workflow run.

# Add your user to the sudo group and enable password-less sudo for all sudoers.
usermod -a -G sudo "$(id -un)"
echo "%sudo ALL = (ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
  • If your workflow uses services, then make sure docker is installed.
curl https://get.docker.com | sh
sudo chmod o+rw /var/run/docker.sock
  • If you are using WSL, check the wsl version of your distro using wsl -l -v.
    Connect your Windows docker service to a WSL 1 distro using this guide, for WSL 2 distro follow this guide.

Windows

  • Windows 7 and above are supported.
  • The runner needs a user account that has Administrative privileges.
# Check that it lists Administrators in Local Group Memberships
net user $env:USERNAME | findstr "Local Group Memberships"
  • Powershell Core 6.0 or newer needs to be installed and added to PATH environment variable.
# Setup Latest Powershell Core using windows Powershell.
Invoke-Expression "& { $(Invoke-RestMethod 'https://aka.ms/install-powershell.ps1') } -AddToPath"
  • If you are using composer, installing 7z will speed it up on Windows.
# Install choco
$installScript = Invoke-WebRequest -Uri "https://community.chocolatey.org/install.ps1" -UseBasicParsing
& ([scriptblock]::Create($installScript))
# Install 7-Zip
choco install -y --force 7zip.install

MacOS

  • MacOS Big Sur 12.x and above are supported. Both Intel and ARM64 macOS are supported.

  • The runner needs a user account having password-less sudo access, otherwise, you would have to enter the password on each workflow run.

  • Run visudo

    sudo visudo
  • Make the following change

    - %admin ALL=(ALL) ALL
    + %admin ALL=(ALL) NOPASSWD: ALL