> ## Documentation Index
> Fetch the complete documentation index at: https://docs.burakov.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosted runner

> Run the Remigent engine on your own machine — your code, model keys and git credentials never leave it.

Remigent never runs your code on its own servers. Your code always executes on **your compute**, in one of
two ways:

| Mode | Where the engine runs | Where code executes | What Remigent stores |
| - | - | - | - |
| **Self-hosted runner** | on your machine | a local, isolated sandbox on the same machine | job status, verdict summaries, pull request links, cost and usage — nothing that contains code |
| **Managed sandbox** | Remigent's engine workers | your own **E2B**, **Daytona** or **Modal** account, with your key | working data derived from your code, encrypted with a key unique to your workspace |

This page covers the self-hosted runner. It is the choice when your code, keys and secrets must stay
inside your own perimeter, when you use a model on your own network, or when you need iOS builds.

The runner is published openly — source at
[github.com/Nickbur/remigent\_runner](https://github.com/Nickbur/remigent_runner), images on `registry.burakov.net`,
free to pull without an account — so you can read exactly what runs on your machine.

## How the runner talks to Remigent

* **Outbound only.** The runner phones home over HTTPS: it picks up jobs, sends heartbeats and reports
  results. Remigent never needs to reach into your network, so you don't open any ports.
* **Its own identity.** When you enroll a runner in your workspace, you get a **runner ID and a secret,
  shown once**. The runner trades the secret for short-lived tokens. You can revoke a runner at any time.
* **Rides out short outages.** If Remigent is unreachable, the runner keeps finishing the work it holds for up to
  24 hours, then pauses until the connection is back.
* **Resumable.** Jobs are checkpointed, so a restart resumes the work or rolls it back cleanly.

## What stays on your machine

* your source code and every piece of working data derived from it;
* your model keys and git credentials.

Only job status, verdict summaries, pull request links, cost and usage, decision logs and escalations
reach Remigent. The runner applies the same [retention rules](https://docs.burakov.net/remigent/security-and-privacy.md#your-data) to its own
store: once a day it deletes working logs older than 90 days, and the working data of projects you disconnected more
than 30 days ago.

## Requirements

* A **Linux** server, **x86-64 or ARM64**, with **Docker Engine** and the **Compose** plugin (or a Mac — see
  [iOS builds](#ios-builds)). On **Ubuntu** or **Debian** the runner's install script sets everything up for you.
* **gVisor** registered with Docker as the `runsc` runtime — it is what isolates the sandbox from your
  host. The install script handles it; on other distributions, see the
  [gVisor install guide](https://gvisor.dev/docs/user_guide/install/), then run `sudo runsc install` and restart
  Docker.
* Resources for parallel sandboxes: each sandbox gets 2 CPUs and 4 GB of memory by default, so the default two
  parallel jobs want **at least 4 CPUs, 8 GB of memory and 80 GB of disk**.
* Outbound HTTPS to Remigent, your git host, your model providers, `registry.burakov.net` and the package registries
  your projects use.

## Set it up

**1. Enroll the runner**

In **Connections → Compute → Runners**, name the runner and choose **Enroll runner**. Copy the three lines it
shows — `REMIGENT_API_URL`, `REMIGENT_RUNNER_ID` and `REMIGENT_RUNNER_SECRET`. The secret is shown only once.

**2. Get the runner**

On your server:

```bash theme={null}
git clone https://github.com/Nickbur/remigent_runner && cd remigent_runner
cp env/env.prod .env
```

**3. Prepare the server**

On Ubuntu or Debian, install Docker Engine, the Compose plugin and gVisor in one go — the script skips
whatever is already there and ends with a test container under gVisor:

```bash theme={null}
sudo bash scripts/install-host.sh
```

**4. Configure it**

In `.env`, set:

* the three values from enrollment;
* `EGRESS_ADMIN_TOKEN` — a long random token, for example the output of `openssl rand -hex 32`;
* `REMIGENT_PROVIDERS` — how the runner reaches the models: your OpenRouter key and/or your own model server
  (see [below](#models));
* `REMIGENT_GIT_CREDENTIALS` — only for git hosts other than the Remigent GitHub App (see
  [below](#git-and-tool-credentials)).

**5. Start the stack**

```bash theme={null}
docker compose up -d
```

The stack has three services: the **runner**, an **egress proxy** that is the sandbox network's only way
out, and a local **database** for the working data that must stay on your machine.

**6. Check it's online**

The runner shows as online in **Connections → Compute**, with its platform and sandbox runtime. On the
server, `docker compose ps` shows the services as healthy. New work for your projects now runs on this
machine.

> [!WARNING]
>
> The runner refuses to start while `EGRESS_ADMIN_TOKEN` is the template placeholder or shorter than 32
> characters. The token guards the list of hosts each sandbox may reach, so it must never be guessable.

## Configuration

| Setting | What it is |
| - | - |
| `REMIGENT_API_URL`, `REMIGENT_RUNNER_ID`, `REMIGENT_RUNNER_SECRET` | the control plane and the runner's identity, from enrollment |
| `EGRESS_ADMIN_TOKEN` | a random token shared by the runner and its egress proxy |
| `RUNNER_CONCURRENCY` | how many jobs run at once (default 2) |
| `SANDBOX_CPUS`, `SANDBOX_MEMORY_MB`, `SANDBOX_PIDS` | resources per sandbox (defaults: 2 CPUs, 4096 MB, 1024 processes) |
| `DOCKER_RUNTIME` | the sandbox runtime: `runsc` (gVisor, default), or `kata-runtime` / `kata-fc` (see [Stronger isolation](#stronger-isolation)) |
| `SANDBOX_IMAGE`, `SANDBOX_IMAGE_FULL` | the sandbox images (defaults: the published `standard` and `full` images) |
| `REMIGENT_PROVIDERS` | how the runner reaches the models, as a JSON list — keys stay on this machine |
| `REMIGENT_GIT_CREDENTIALS` | credentials for git hosts other than the GitHub App, as a JSON list |
| `REMIGENT_MCP_CREDENTIALS` | credentials for the [MCP tools](https://docs.burakov.net/remigent/security-and-privacy.md#tools-from-other-services) you allow, as a JSON list |
| `LOG_LEVEL` | `debug`, `info` (default), `warn`, `error` |

### Models

Remigent runs only on open-weight models it has selected. A list with your OpenRouter key and your own vLLM server
looks like this:

```json theme={null}
[
    { "id": "or", "adapter": "openrouter", "apiKey": "sk-or-…" },
    {
        "id": "gpu",
        "adapter": "local",
        "baseUrl": "http://localhost:8000/v1",
        "options": { "models": "…" }
    }
]
```

There are two adapters: `openrouter` and `local` — any OpenAI-compatible server on your own hardware. For a `local`
server, `options.models` lists the models it serves, comma-separated, and `options.embeddingModel` its embedding model.
The model IDs to use are shown in the dashboard under **Connections → Models** when you choose your own server; write
`<ID>=<name>` when your server serves a model under another name. Whatever your server doesn't serve goes through
OpenRouter. See [Open-weight models](https://docs.burakov.net/remigent/your-own-models.md). Put the list on one line in `.env`.

### Git and tool credentials

Repositories connected through the **Remigent GitHub App** need nothing here: the runner receives a short-lived token
for each job. For any other git host — GitLab, Gitea or your own server — the credentials stay on the runner: give it
a token or an SSH deploy key per host:

```json theme={null}
[{ "baseUrl": "https://git.example.com", "username": "remigent", "token": "…" }]
```

Credentials for MCP tools are listed by the server's name in **Connections → Tools (MCP)**, with a token, extra
headers or environment variables:

```json theme={null}
[{ "server": "sentry", "token": "…" }]
```

## Images and updates

| Image | Tags | What it is |
| - | - | - |
| `registry.burakov.net/remigent-runner` | `1`, `1.2`, `1.2.3`, `latest` | the engine and the egress proxy |
| `registry.burakov.net/remigent-sandbox` | `1`, `1.2.3` | the **standard** sandbox: JavaScript / TypeScript and Python toolchains, plus the verification tools |
| `registry.burakov.net/remigent-sandbox` | `1-full`, `1.2.3-full` | the **full** sandbox: standard plus Go, Rust and load testing |

Every image is built for x86-64 and ARM64. The `1` tags follow the latest 1.x release; pin an exact version such as
`1.2.3` if you prefer to update by hand. The runner pulls the sandbox images itself the first time it needs them.

To update:

```bash theme={null}
git pull
docker compose pull
docker compose up -d
```

A stopping runner gives its in-flight jobs **5 minutes** to finish; a job that takes longer is picked up again
after the restart.

## Stronger isolation

gVisor gives every sandbox its own user-space kernel. If your policy requires hardware virtualization, install
[Kata Containers](https://katacontainers.io/), register it with Docker as a runtime and set `DOCKER_RUNTIME` to that
runtime's name — for example `kata-runtime`, or `kata-fc` for Kata on Firecracker microVMs. Nothing else changes.

## iOS builds

iOS apps can only be built on macOS. On a Mac, the runner builds in a **macOS virtual machine with Xcode**
(via [Tart](https://tart.run)) instead of a Docker sandbox, so it runs directly on the Mac rather than in Docker:

**1. Prepare the Mac**

Install [Tart](https://tart.run) and Node.js 24, and create an SSH key the runner will use to reach the VM.

**2. Configure the runner**

In `.env`, set `SANDBOX_DRIVER=tart`, `TART_IMAGE` (default: Cirrus Labs' macOS image with Xcode),
`TART_SSH_USER` and `TART_SSH_KEY` (the path to the private key authorized in the image), plus the enrollment
values and your model providers.

**3. Start it**

```bash theme={null}
npm install && npx tsc -p tsconfig.json && node dist/main.js
```

Projects whose recipe declares `platform: macos` are then sent only to this runner.

## Revoking a runner

Revoke a runner in **Connections → Compute → Runners**. It stops receiving work immediately, and the work it
held is handed to another runner. A revoked runner is refused the next time it starts; to move to a new machine,
enroll a new runner there and revoke the old one.

## Troubleshooting

| What you see | What to do |
| - | - |
| `EGRESS_ADMIN_TOKEN is still the template placeholder` / `must be at least 32 characters` | Set a random token: `openssl rand -hex 32`. |
| `Docker runtime "runsc" is not registered with the daemon` | Run `sudo bash scripts/install-host.sh` — or install gVisor, run `sudo runsc install` and restart Docker. |
| `REMIGENT_RUNNER_ID and REMIGENT_RUNNER_SECRET are required` | Paste the values from enrollment into `.env`. |
| `runner enrollment refused` | The runner was revoked or the secret is wrong — enroll a new runner. |
| The runner is **unhealthy** in `docker compose ps` | It hasn't reached Remigent for over 24 hours — check outbound HTTPS from the server. |
| The runner never shows as online | Check `docker compose logs runner`; the first lines name the problem. |

> [!NOTE]
>
> The sandbox never receives your model keys or git credentials. The runner pushes branches and opens
> pull requests itself, from outside the sandbox. See [Security & privacy](https://docs.burakov.net/remigent/security-and-privacy.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.