Skip to main content
A Mac cannot give a build a container of its own, but a Linux VM can. On both routes below, builds run in containers in a VM and record container, as on a Linux host. A Mac can also host a runner that builds in sandboxes that OuterLayer provides, with no Docker and no VM. Run outerlayer runner init --sandbox. See Build in a managed sandbox. Both routes above work on Apple silicon and on Intel Macs. A runner installed directly on the Mac does not use Docker Desktop: there, runner init offers only the Lima VM.

Docker Desktop

Follow Run the runner in a container. Before you start, read its Docker Desktop section. It gives the memory, CPUs and disk the default limits need, the settings that start the runner after a reboot, and Docker’s license terms.

Set up a Lima VM

outerlayer runner init --vm makes a small Linux VM with Docker Engine, which Lima runs. It installs the runner in the VM as a service. You do not open a shell in the VM.

Before you start

You need:
  • Node.js 22.15 or later, and the CLI on the Mac: npm install -g @outerlayer/cli.
  • Lima. Install it with brew install lima.
  • A login. Run outerlayer login on the Mac. It tells setup which factories you can use.
  • A way to create a runner key. Setup prints the link to the factory’s API keys page and asks you to paste a key with the Runner preset. See Give the runner its key. If you cannot create the key, see If you cannot create the key. Setup moves a key from that config file into the VM.
  • A Claude token, from claude setup-token.
  • Room for the builds. With the default limits the VM gets 5 CPUs, 11 GiB of memory and 110 GiB of disk. See Size the VM.
  • A network. The first run downloads an Ubuntu image, Node.js and the CLI.

Run setup

  1. Read the token into a variable. Nothing shows as you paste.
  2. Run setup, with the token on standard input:
  3. Paste the runner key when setup asks, then press Enter.
  4. Check the runner from the Mac:
<org>/<factory> is the factory’s name in its dashboard address, app.outerlayer.ai/orgs/<org>/factories/<factory>. Leave --factory out if your login can use only one factory. Without --vm, runner init asks on a terminal whether to make the VM. In a script, it refuses and names --vm and the runner image. To use an agent other than Claude Code, leave --agent out. See Using another agent. The runner’s config file in the VM is ~/.outerlayer/config.json. If a step in the VM fails, the Mac’s config file is unchanged. Delete the half-built VM with limactl delete --force outerlayer-runner, then run setup again.

What setup makes

  • A Lima VM named outerlayer-runner. No directory of the Mac is mounted in it, so a build cannot read your home directory. The VM holds the CLI, the runner key, the host key and the Claude credential.
  • A systemd service in the VM, outerlayer-runner. It is the same service as on Linux. See Run the runner as a service.
  • A launch agent on the Mac, ai.outerlayer.runner-vm. Its file is ~/Library/LaunchAgents/ai.outerlayer.runner-vm.plist. It starts the VM when you log in, and the VM starts the service. Before you log in, the runner does not run.
  • A runnerVm key in the config file you named with --config. It names the VM. The file holds no runner key.
The runner key is never written on the Mac, and your login stays as it is.

If the Mac had a runner before

  • A runner key that was in the config file moves into the VM. The file loses apiKey and runner. If you used that key for capture on the Mac, run outerlayer login there again.
  • A runner key bound to the Mac’s old host key is refused. A member must choose Clear host key on the key in Settings → API keys.
  • Setup refuses a runner block that names hooks, such as builtin:container. Remove the block and run setup again.
  • Setup refuses when the config file has a runnerVm key, or the VM outerlayer-runner exists. The refusal says how to start or delete that VM.

Size the VM

Setup sizes the VM from runner.concurrency and the build limits (runner.build.cpus, runner.build.memory and runner.build.disk). It never gives the VM more CPUs or memory than the Mac has. Setup makes no VM when the builds do not fit the Mac’s memory. Lower runner.concurrency or runner.build.memory. See Memory limits and Disk fit. To change the size later:
  1. Edit ~/.lima/outerlayer-runner/lima.yaml.
  2. Run limactl stop outerlayer-runner.
  3. Run limactl start outerlayer-runner.

Operate the runner

Run runner commands through limactl shell outerlayer-runner. In the VM, leave out --config:
On the Mac, these commands help:

Change the runner’s config

  1. Open a shell in the VM: limactl shell outerlayer-runner.
  2. Edit ~/.outerlayer/config.json. The runner reads most changes on its next poll.
  3. For a change to runner.env or claude.env, run sudo systemctl restart outerlayer-runner.
  4. For a change that the service’s unit depends on, run this on the Mac:
    Re-run the service lists those changes. The command also rewrites the launch agent.

Update the runner

The runner in the VM updates itself to the version your factory names. Installing a new CLI on the Mac does not update it. To update it by hand, see A runner in a Lima VM on a Mac.

Remove the runner

  1. Remove the service and the launch agent. Use the --config that you gave to runner init:
  2. Delete the VM. The runner key and the host key exist only in the VM, so this removes both.
  3. Remove the runnerVm key from the config file.
  4. Delete the runner key in Settings → API keys.

A second factory on the same Mac

One Mac runs one VM, and outerlayer runner init --vm refuses to make a second. The one VM can run a runner for a second factory. Each runner needs its own runner key, its own config file in a directory of its own, and its own service.
  1. Raise the VM’s CPUs, memory and disk, as Size the VM shows. Setup sized the VM for one runner’s builds.
  2. Set up the second runner inside the VM:
  3. Check the second runner from the Mac:
The Mac’s launch agent starts the VM, and so both runners, at login. See Several factories, one machine.