outerlayer runner init, writes the runner’s config file and starts
the service that keeps the runner running.
Not on Linux, or want the runner image? Find your machine in
Choose how to run the runner.
Then follow the page it names.
Before you start
You need:- Node.js 22.15 or later, and the CLI:
npm install -g @outerlayer/cli. A service needs a fixed path to start, so use the global install, notnpx. - About 10 GiB of memory and 40 GB of free disk, with the default limits. See Memory limits and Disk fit.
- Outbound HTTPS to the gateway (
api.outerlayer.ai),github.com,api.anthropic.comandregistry.npmjs.org. A runner that builds in containers also needs Docker Hub. See A build host. - A way to create an API key on the factory. The owner, admin and write roles can. If you cannot, see If you cannot create the key.
- The factory’s name, as
<org>/<factory>. It is in the factory’s dashboard address,app.outerlayer.ai/orgs/<org>/factories/<factory>. - A connected repository. The GitHub App is installed on it, and
outerlayer inithas added the/buildskill to it. See Connect a repository and the Quickstart. Without the GitHub App, every build fails at provision withrepository_not_in_installation. - For builds in microVMs: x86_64 Linux where the runner’s account can
open
/dev/kvm. A microVM host needs no Docker. - For builds in containers: Docker Engine 26 or later, usable by the runner’s account, and Docker’s Buildx plugin, 0.18 or later.
- For builds in sandboxes that OuterLayer provides: no Docker and no KVM.
A Linux machine or a Mac with neither can run a runner with
outerlayer runner init --sandbox. A Mac needs no Linux VM for it. See Build in a managed sandbox.
sudo usermod -aG kvm <account> for KVM, or
sudo usermod -aG docker <account> for Docker. Then log in again. The
docker group gives root rights in practice.
Give the runner its key
The runner needs a key of its own: an API key with the Runner preset. Use one new key for each runner. The runner’s first claim binds the key to this host, andrunner init refuses a key that another host already used.
See The host key.
First decide which kind of runner this host runs:
- A personal runner builds only the work you ask for. Use it when the
runner builds with your own Claude subscription.
runner initasks you to approve its key in your browser, so you create and paste nothing. - A shared runner builds the work of every member who has no personal
runner. Use it for a team server. Give it an API key, such as an Anthropic
API key, and not a Claude subscription: a subscription belongs to one person.
Create its runner key yourself, as below, and pass
--sharedtorunner init.
-
Log in on the host, and approve the link that the command prints. On a
host with no browser, add
--no-browserand open the link on another machine.
- In the factory, open Settings → API keys.
- Choose Create API key, and pick the Runner preset.
- Keep the page open. The key shows once, and you paste it when
runner init --sharedasks.

The Create API key dialog with the Runner preset chosen.
--config ~/.outerlayer-runner/config.json.
That file keeps the runner key apart from your own login, which is in
~/.outerlayer/config.json. A runner key in your own file would replace
your login, and your sessions would switch factory.
Give the runner Claude’s credential
A runner that builds with Claude Code needs a Claude credential. A build never sees the credential itself. For a runner that builds only with Codex, see Build with Codex instead. Create a token on any machine where Claude Code is installed, such as your laptop:Run outerlayer runner init
-
Read the token into a variable.
read -rskeeps it off the screen and out of your shell history. -
Run
runner init, with the token on standard input:For a shared runner, add--shared. -
For a personal runner, approve the key in the browser page that
runner initopens. Check that the page shows the same code as the terminal. For a shared runner, paste the runner key whenrunner initasks, then press Enter. Nothing shows as you paste.
runner init then does this:
- It checks the key with the gateway and writes the config file, readable only by your account.
-
It picks the built-in hooks that fit the machine:
-
It writes a command for each queue that starts Claude Code. Builds run on
Opus, and amends run on Sonnet. To change a model, edit
runner.commandsin the config file. -
It stores the credential in
claude.env, beside the config file, readable only by your account. -
It installs and starts the service, and asks for
sudowhere it needs root. See What the service sets.
runner init refuses, and writes nothing, in these cases:
- The machine cannot isolate a build. The refusal names the fix: Docker Engine 26 or later, or access to KVM.
- The config file already holds a
runnerblock, and no agent is named. Edit the block, or remove it and runrunner initagain. With--agent, the command adds that agent to the block instead. - Your login can use several factories and you named none. It lists each
factory as a
--factoryvalue.
--app-id with the Factory ID from Settings → General works in
place of --factory.
To use your own isolation, see Write your own hooks.
Check the runner
runner init starts the service, so the runner can take work before you run
this check:
check validates the config, confirms that the key works, and prints the
settings the runner uses, including its hooks. It exits 1 and says what to
fix when something would fail every build, for example:
- A queue’s command is still the placeholder.
- A
claudecommand has a--permission-modethat Claude Code does not accept, such asbypassPermissons. - Built-in hooks find no credential for a listed agent.
- The key does not hold
work.claim. Create it with the Runner preset.
credentials unverified, the gateway did not answer normally.
Run it again later.
outerlayer doctor --config ~/.outerlayer-runner/config.json reports on the
host as well. What each line means is in
outerlayer doctor.
Build your first item
Ask for a build as yourself, not with the runner key. A build requested with a runner key gets no repository tokens, so it fails. Either:- choose Build beside the issue on the Work page, or
-
run this from your own machine:
Watch it run
From a second terminal on the host:status lists running builds and their stage. logs -f follows one item’s
build log. status --recent shows finished builds.
The session and the pull request show on the item’s page. The factory’s
Settings → Runners page lists the runner.

Settings → Runners lists each runner, its version and its status.
What keeps the runner running
The service thatrunner init installed restarts the runner after a crash,
a reboot and an update. You write no service file.
To change the service, size the host, update the runner or remove it, see
Run the runner as a service.
Run the runner in a terminal instead
The service and a terminal runner cannot use the same config file. Remove the service first, then start the runner:Build with Codex
A runner that builds with Codex needs an OpenAI API key and no Claude credential. A runner build cannot use a ChatGPT login.-
Read the key into a variable:
-
Run
runner init, with the key on standard input:
runner init writes a command for each queue that starts Codex. It stores
the key in codex.env, beside the config file, readable only by your
account. Codex also judges and reviews the runner’s Codex builds.
To add Codex to a runner that already builds with Claude Code, run the same
command on its config file. The command keeps the Claude credential. Then
run outerlayer runner install --service --replace and restart the runner,
so the service loads codex.env. See Build with several
agents.
Using another agent
On a terminal,runner init without --agent asks which agent builds
start, and then asks for its credential. To use an agent that runner init
does not list:
- Answer
none.runner initwrites a placeholder command for each queue and stores no credential. The runner claims nothing while a command is the placeholder. - Edit
runner.commandsin the config file to start your agent on item$OUTERLAYER_WORK. The runner reads the edited file on its next poll. - Put the credentials your agent needs in
runner.env, beside the config file. Make the file readable only by the runner’s account. - Restart the service, which reads
runner.envonly when it starts.
Other ways to give the runner its key
If you cannot create the key
Ask a member who can create keys to make one with the Runner preset. Then put the key in the config file yourself. Do the same whenrunner init
has no terminal to ask on, such as in a script.
Run these lines one at a time. Each read waits for you to paste a value
and press Enter. read -rs shows nothing as you paste. The Factory ID
is on the factory’s Settings → General tab.
echo prints 0 characters, the key is empty. Run the read line
again before you write the file.
runner init then uses this key and asks for none. Leave --factory out of
the commands on this page, because the config file already names the
factory.
Save the key with outerlayer login
On a machine that only runs the runner, you can save the key with
outerlayer login instead. The key is read from standard input, so it stays
out of your shell history. The dialog that shows the new key also shows this
command, filled in.
--config out of every command on this
page.