What this guide covers
When you finish, the GitLab project's jobs can be sent to this Mac by tag. You need: Maintainer access to the project, a working remote desktop connection, and Xcode installed.
Steps
Install the binary
GitLab's macOS installation documentation has you download the official binary to
/usr/local/binand make it executable, with separate download URLs for Intel and Apple silicon. Those two commands need elevated privileges, so we do not reproduce them here; run them as written in the documentation and enter the admin password when prompted.The documentation also says the Homebrew package of the same name is not maintained by GitLab, and that the official binary is the recommended choice.
Create the runner in GitLab and get the token
In the project's Settings > CI/CD, expand Runners and create a new project runner. Enter tags in the Tags field (for example
macos,ios), separated by commas. Whether you tick "Run untagged jobs" decides whether it picks up jobs without tags; for a build machine it is usually left unticked.After creation, the page shows the runner authentication token. According to the registration documentation, tokens of this kind start with
glrt-.Register, choosing the shell executor
gitlab-runner registerFollow the prompts to enter the GitLab URL, the authentication token, a description, tags, a maintenance note and the executor type. The official macOS documentation states that iOS and macOS builds use the shell executor, with jobs running directly on this Mac as your user.
The configuration is written to
~/.gitlab-runner/config.toml. It contains the token, so do not paste it to anyone.The service must be installed from a graphical terminal
cd ~ gitlab-runner install gitlab-runner startThe documentation stresses that this step has to be done in a terminal in the machine's graphical interface, not over an SSH session, or you get launchctl-related errors. For a remote Mac, that means entering the desktop with UU Remote or RustDesk and running the commands in the Terminal app.
The "reboot your system" step in the official instructions
The last step in the documentation is to reboot the system. On a rented machine, restart with Restart on the machine details page in the customer console, or with Restart in the Apple menu on the remote Mac. Do not submit both at the same time, and do not shut down. Save your work and stop other jobs first, then reconnect to the desktop after the restart to confirm.
Understand how it runs and its limits
The documentation explains that on macOS GitLab Runner runs as a user-mode LaunchAgent, not a system-level daemon: it starts when the user logs in and stops when the user logs out. It needs access to the keychain and a graphical session to do code signing and use iOS simulators. The documentation also notes that for it to be available automatically after a reboot, auto-login has to be enabled.
Auto-login touches login and disk encryption settings, so on a rented machine ask support to assess it first. Until then, connect and log in yourself after each restart, and check the logs to confirm:
~/Library/Logs/gitlab-runner.out.logandgitlab-runner.err.log.Network direction, upgrades and ending the rental
The official execution flow diagram shows the runner repeatedly asking GitLab for jobs with its token and reporting results back. In other words this Mac initiates the connection to GitLab, and no port has to be mapped to the outside for it. Your GitLab instance must be at an address this machine can reach.
To upgrade, run
gitlab-runner stop, download the binary again as the documentation describes, thengitlab-runner start. Before the rental ends, rungitlab-runner stopandgitlab-runner uninstall, and delete the runner in the GitLab interface so the token becomes invalid.
FAQ
Why not use the Docker executor?
iOS builds need Xcode on macOS, and Xcode cannot run inside the usual Linux containers. That is why the official documentation specifies the shell executor for iOS and macOS builds.
Signing fails in a job with a message that the keychain cannot be accessed. What should I check?
First confirm the runner was installed in the logged-in user's graphical session. The troubleshooting section of the official documentation also mentions that the SessionCreate setting in the service configuration is related to one class of keychain errors; go by the documentation for the fix. For the general approach, see our keychain guide.
Is the shell executor safe?
Jobs run directly as your user and can read every file under that user, including certificates and credentials. So accept only projects you trust, and do not make this runner shared across the whole instance.
Our GitLab is on the company's internal network. Can this Mac reach it?
It depends on whether your GitLab has an address this machine can reach. Before installing tunneling or mesh networking software on the rented Mac for this purpose, check with Contact support first; do not change the network configuration yourself.
Related
- Rented Mac mini as an always-on build machine for small teams? Count your build minutes first
- How to keep long tasks running on a remote Mac mini after you disconnect
- Code signing hangs on a CI Mac: unlock the keychain or use a dedicated one
- Self-hosted Mac CI build cache: what to keep and what to clear every time
- Remote Mac vs GitHub Actions macOS runner or Codemagic: which should I use?
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support