Docs

Quick start

Connect two of your machines and run your first remote command. Here macbook, a Mac, creates and manages the network, and devbox, a Linux machine, is the target. Windows uses the same commands.

Install xrun on both machines

Public downloads are not available yet, so build from source on each machine. You need Rust (through rustup) and Bun. The built CLI needs no Rust, Node.js or Bun at runtime.

macOS / Linux

git clone https://github.com/xrun-sh/xrun.git
cd xrun
bun install --cwd cloudflare --frozen-lockfile
bun run --cwd cloudflare package
XRUN_CLOUDFLARE_BUNDLE_DIR="$PWD/cloudflare/.wrangler/package" cargo build --locked --release

Windows · PowerShell

git clone https://github.com/xrun-sh/xrun.git
cd xrun
bun install --cwd cloudflare --frozen-lockfile
bun run --cwd cloudflare package
$env:XRUN_CLOUDFLARE_BUNDLE_DIR = "$PWD\cloudflare\.wrangler\package"
cargo build --locked --release

If you only use a self-hosted Linux relay, cargo build --locked --release is enough. The extra Bun steps embed the Cloudflare relay so that xrun relay deploy --provider cloudflare works.

The executable is target/release/xrun (xrun.exe on Windows). Keep it in a fixed directory on your PATH: the background service records its absolute path.

To use the binary from the build directory, add it to PATH in the current terminal:

macOS / Linux
export PATH="$PWD/target/release:$PATH"
Windows · PowerShell
$env:Path = "$PWD\target\release;$env:Path"

Full build and desktop packaging guide

Deploy a relay

Every device connects out to a relay you own. Pick either option; both offer the same features.

Cloudflare

Run this on macbook. Your browser opens so you can authorize xrun on your Cloudflare account. Wrangler and Node.js are not needed.

On macbook

xrun relay deploy --provider cloudflare --name xrun-relay

It prints the relay’s https:// address. Deploying again with the same name updates the relay and keeps its address and data.

Self-hosted Linux server

Run this on a Linux server with systemd that all your devices can reach. It installs a user service on TCP 9528 (IPv4 only). Open that port in your firewall or security group.

On the Linux server

xrun relay deploy --provider local --addr <server-ip>:9528

It prints an xrun-relay:// deployment link that pins the relay’s certificate. The link is not an access credential.

Create the network

On macbook

xrun connect '<deployment link>' --name macbook

Replace the placeholder with the complete link from the previous step. macbook becomes the manager and starts its background service. Where the relay runs does not decide which device is the manager.

Invite devbox

On macbook

xrun invite

It prints the relay address and an eight-character access code such as K7M4-P9Q2. Codes are single-use, expire in 10 minutes and allow 5 attempts.

On devbox

xrun connect relay.example.com K7M4-P9Q2 --name devbox --allow-manager

Use the address and code that invite printed. --allow-manager lets macbook use devbox and grants nothing else. Joining a network by itself grants no access.

Verify

On macbook

xrun status
xrun devbox -- uname -s

status should list devbox as relay-connected, and the command should print Linux with exit code 0. On SOURCE_NOT_ALLOWED, run xrun allow-from macbook on devbox. On DEVICE_OFFLINE, check xrun status on devbox and start its service with xrun daemon start.

Run background jobs

start returns as soon as the target accepts the job. Replace K7Q2MX with the ID it prints.

On macbook

xrun devbox start -C /home/dev/app -- cargo test
xrun devbox logs K7Q2MX --tail 40
xrun devbox wait K7Q2MX --timeout 60

Accepted jobs keep running when the caller disconnects or sleeps; query them again later. wait --timeout limits only the wait, never the job. Agents and scripts should add --json and a --request-id so that a retry never runs a job twice.

Next steps

  • Bring files back, SHA-256 verified

    xrun devbox pull /home/dev/app/report.html ./report.html
  • Open a remote dev server in your local browser

    xrun devbox forward 8080:3000
  • Read the full manual offline

    xrun doc

xrun help gives a quick reference, and xrun doc reads the full manual offline.