# Add a Linux build machine for your Mac’s agents

> Keep your agents on your Mac and let a Linux server or rented machine you pair run their builds and tests. Nothing signs in to Claude or Codex there.

- **Category:** Setup and safety
- **Updated:** 2026-12-01
- **Reading time:** 5 min
- **Canonical page:** https://cmdbrief.com/guides/linux-build-machine

## What you get

- **Your Mac:** Agents think and edit; Their Claude and Codex sign-ins; Files git ignores, such as `.env`; Xcode runs
- **Linux build machine:** Builds and tests: `cargo`, `npm`, `pnpm`, `node`; In a copy of the project; No agent sign-in
- **Your Mac → Linux build machine:** builds and tests
- **Linux build machine → Your Mac:** their output
- **Connection:** A direct line: the same network, or Tailscale on both

Your agents keep thinking and editing on your Mac. When one runs a build or a test (`cargo`, `npm`, `pnpm` or `node`), CmdBrief sends it to the Linux computer you paired, runs it there in a copy of the project, and streams the output back into the agent’s shell. The agent reads it as if it had run on the Mac.

- Nothing signs in to Claude, Codex or any other agent on the build machine.
- Files git ignores, such as `.env`, stay on your Mac unless they were committed before.
- A run there writes only in its copy of the project, its build caches and temp folders. CmdBrief keeps it out of the folders where Claude, Codex and the other agent CLIs, SSH and the system keychain keep their sign-ins.
- Xcode runs always stay on the Mac.
- The machine keeps its copy of the project, so later runs send only what changed.

> **Tip:** Agents setting this up for someone: follow the steps in order. The steps marked “You do this” need the person; ask them and wait.

## Before you start

- A Linux computer on 64-bit Intel or AMD (x86_64) with glibc 2.35 or newer (Ubuntu 22.04, Debian 12 or later) and systemd, with the toolchains your project builds with.
- A network the Mac and that computer share: the same local network, or [Tailscale](https://tailscale.com/kb/1017/install) on both.
- CmdBrief signed in on your Mac.
- A terminal on the Linux computer for you (SSH is fine). An agent can do the checks over SSH, but signing in and pairing need you.

## Check the Linux computer

**Step 1 of 4 · An agent can do this** (On the Linux computer, or over SSH)

**On the Linux computer**

```bash
uname -m                                  # x86_64
ldd --version | head -1                   # 2.35 or newer
tailscale status 2>/dev/null | head -3    # or: on the same network as the Mac
node -v; npm -v; pnpm -v; cargo -V        # whichever your project builds with
```

Install any missing toolchain in your home folder there. Builds on that computer see the toolchains, caches and Git settings in the home folder.

## Install CmdBrief and sign in

**Step 2 of 4 · You do this** (In your own terminal on the Linux computer)

**On the Linux computer**

```bash
curl -fsSL https://cmdbrief.com/install.sh | sh
```

It installs CmdBrief in `~/.local/bin`, runs it as a user service, signs this computer in with the code from your email, turns sharing on and shows the code to pair. When it says another computer must approve this one, approve it on your Mac in Settings › Computers.

Or step by step: download `CmdBrief-*-linux-x86_64.tar.gz` from [the Linux download](https://cmdbrief.com/api/v1/app-download?platform=linux-x86_64), then:

**On the Linux computer, step by step**

```bash
tar -xzf CmdBrief-*-linux-x86_64.tar.gz
cd CmdBrief-*-linux-x86_64 && ./install.sh
cmdbrief login                       # type the code from your email
cmdbrief service install             # keep it running as a user service
sudo loginctl enable-linger $USER    # keep it running after you log out
cmdbrief share on                    # let your other computers see it
```

**Check it worked**

| Where | Run or do | Pass |
| --- | --- | --- |
| Linux computer | `systemctl --user is-active cmdbrief` | It prints `active`. |
| Linux computer | `loginctl show-user "$USER" -p Linger` | It prints `Linger=yes`. |

## Add it as a builder from your Mac

**Step 3 of 4 · You do this** (On your Mac, with the Linux terminal open)

1. On the Mac, open Settings › Computers › **Set up a build computer…** and pick the Linux computer.
2. When the sheet asks for a code, run `cmdbrief pair` on the Linux computer and type the 6 digits it prints into the sheet. Pairing codes are for your eyes: CmdBrief keeps them away from agents.
3. The sheet turns on the computer’s “Take builds and tests from my other computers” switch and checks its system, the connection, Rust, Node with npm and pnpm, and Xcode. A missing one says which runs stay on the Mac.
4. Press **Try it** for a trial run. Done says whether the computer is now a builder.

On the Linux computer, `cmdbrief builder on` turns the same switch on.

**Check it worked**

| Where | Run or do | Pass |
| --- | --- | --- |
| Linux computer | `cmdbrief computers` | Your Mac is listed with full use and a direct line. |
| Linux computer | `cmdbrief builder status` | The switch is on, it has free slots, and your toolchains are found. |

## Send this workspace’s builds there

**Step 4 of 4 · You do this** (On your Mac, in the workspace’s settings)

Open the workspace’s settings, set **Builds and tests run on** to the Linux computer, and save.

> **Warning:** **Automatic** only picks a builder with the same system and chip as this computer, so a Mac never sends builds to Linux until you name the Linux computer here.

**Check it worked**

| Where | Run or do | Pass |
| --- | --- | --- |
| Mac | Run one build in the workspace, for example `npm test` | The step’s chip shows the Linux computer’s name. |

A run that goes across systems first prints a line like: “CmdBrief: build-box runs Linux on x86_64, not macOS on aarch64 like this computer; `npm test` runs there as this workspace asks.” A run that stayed on the Mac prints “… so `npm test` runs here.”, and the words before “so” say why.

## If it fails

| What it says | Fix |
| --- | --- |
| “no builder is reachable (build-box is offline)” | Check `systemctl --user status cmdbrief` there, and that both computers share a network or are on Tailscale. |
| “build-box doesn’t build for other computers” | Turn the switch on in Settings › Computers, or run `cmdbrief builder on` there. |
| “build-box runs an older CmdBrief that can’t build for other computers” | Update CmdBrief on the Linux computer. |
| “build-box doesn’t have npm installed” | Install it in your home folder there, then press Check again on the builder’s row. |
| “Ran here: no builder has the same system and chip.” | The workspace is on Automatic. Name the Linux computer in Builds and tests run on. |
| “Runs here see only the toolchains, caches and Git settings in the home folder…” | **You:** If the build needs that file, turn on “Let runs read the whole home folder” for this builder in Settings › Computers. |
| A build can’t reach Docker or a local database there | **You:** A sent Linux build can’t use Docker or UNIX-socket services. Run those on the Linux computer itself; TCP on 127.0.0.1 still works. |
| “build-box stopped answering, so … was cut off and ends with an error; it is not rerun here.” | The connection dropped during the run. Run it again: it goes there once the computer is back, and runs on the Mac until then. |
| The Mac says “Connect both to the same network or to Tailscale” | Bring up Tailscale on both computers, or put them on one network. |

## Undo

On the Linux computer, `cmdbrief builder off` stops it building for your other computers, and `cmdbrief builder clean <project>` removes the copy kept there. Unpair it in Settings › Computers on the Mac.

## Questions

### Does the build machine need my Claude or Codex sign-in?

No. The agents run on your Mac with their own sign-ins. The build machine only runs builds and tests.

### Why do my builds still run on the Mac?

With the workspace on Automatic, a Mac sends builds only to a builder with the same system and chip. Name the Linux computer in the workspace’s Builds and tests run on.

### What happens when the build machine is off?

New runs go back to the Mac with one line saying why. A run that was going when it stopped ends with an error and is not rerun on its own.

## Primary sources

Provider terms and product behavior can change. Confirm plan, pricing, model, and permission details in the current official documentation.

- [Tailscale: install](https://tailscale.com/kb/1017/install)
- [systemd: loginctl enable-linger](https://www.freedesktop.org/software/systemd/man/latest/loginctl.html)

## Keep reading

- Setup and safety: [Run your agents on a Linux server and close your laptop](https://cmdbrief.com/guides/run-agents-on-a-linux-server)
- Setup and safety: [Use CmdBrief on a rented cloud machine](https://cmdbrief.com/guides/cmdbrief-on-a-rented-machine)
- Setup and safety: [Claude Code sandbox and permissions: how to run it safely](https://cmdbrief.com/guides/claude-code-sandbox)

---

Markdown mirror of https://cmdbrief.com/guides/linux-build-machine, generated at build time from the same data the HTML page renders. Machine-readable index: https://cmdbrief.com/llms.txt
