Home/Guides/Install GitLab Runner on a remote Mac and register it with the shell executor

Install GitLab Runner on a remote Mac and register it with the shell executor

Updated · airankrush

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

  1. Install the binary

    GitLab's macOS installation documentation has you download the official binary to /usr/local/bin and 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.

  2. 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-.

  3. Register, choosing the shell executor

    gitlab-runner register

    Follow 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.

  4. The service must be installed from a graphical terminal

    cd ~
    gitlab-runner install
    gitlab-runner start

    The 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.

  5. 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.

  6. 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.log and gitlab-runner.err.log.

  7. 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, then gitlab-runner start. Before the rental ends, run gitlab-runner stop and gitlab-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.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All guides