# Run your own computer (Olef Host)

Source: https://olef.dev/docs/cloud/hosts

**Outcome:** run Olef Cloud workspaces and persistent managed agents on your own Mac Mini, Linux workstation, or office build server, and optionally share USB/Wi-Fi Android devices from the same machine.

## Why run your own host?

- **Reach private networks and internal services:** run agents against internal APIs, private package registries, corporate VPN resources, or staging databases without opening inbound firewall ports.
- **Use hardware you already own:** fast Apple Silicon Macs or Linux workstations run heavy Rust, Node, Python, Docker, or Gradle builds without per-minute cloud VM bills.
- **Keep source code on-premises:** workspace sessions and agent runs execute directly on your host while still working with Olef's inboxes, SSH/previews, macOS tray Inbox, and team grants.
- **Enable `--live` local checkout debugging:** Olef Host powers the tunnel that routes live cloud events straight to your laptop during `ocloud agent checkout --live`.
- **Optional Android device lab:** enroll USB phones, tablets, or Wi-Fi devices (Android TV / Fire TV sticks) and lease them across your team (`lab:<host>/<device>`) with automatic post-lease baseline resets.

## 1. One-step workstation setup

On the Mac or Linux machine you want to host from (with `ocloud` installed):

```bash
ocloud login
ocloud host setup
```

`host setup` registers the machine with your personal org (or `--org <org>`), enables workspace hosting, sets up the background service, and checks wake/sleep and network conditions that could make the machine unreachable.

Configure runtime mode, concurrency slots, and managed-agent eligibility explicitly:

```bash
ocloud host set runtime native        # `none` (devices only), `native`, or `vm`
ocloud host set slots 4               # concurrent workspace sessions (1–64)
ocloud host set agents on             # allow managed agent runs on this host
ocloud host service install           # prints the sudo command to install the daemon
ocloud host status
```

On native hosts, managed agent runs execute under a **dedicated, isolated OS account** rather than your personal login user, separating cloud agent files, credentials, and environment from your personal home directory.

## 2. Target a host pool from workspaces and agents

Grant a team access to your host pool, then link any project or create an agent targeting it:

```bash
ocloud host pools
ocloud grant pool <pool-id> team:backend --role developer

# Link a project workspace onto your host pool
ocloud link --template general --on host:<pool-id>

# Or place a managed agent directly on your host
ocloud agent create backend/builder --template general --where <pool-id>
```

## 3. macOS menu-bar app (Host + Cloud User Inbox)

On macOS 13+, the standalone **Olef** menu-bar app serves two audiences:

- **Cloud-only users (no local host needed):** native macOS notifications and a lightweight **Needs you** inbox for agent questions, approvals, threads, and local checkout controls (`--edit`, `--live`, `open`).
- **Host operators:** live online/offline status icon and slot meter, **Stay Awake** control while serving workspaces, quick jump into workspace folders, and one-click device-lab controls.

## 4. Optional: enroll USB and Wi-Fi Android devices

If your host machine also has physical Android phones or TV devices attached, the host manages its own isolated `adb` server and key, exposing only devices you explicitly enroll:

```bash
ocloud host devices                                # see devices attached to the host's adb
ocloud host pair 192.168.1.42:37123 482910         # wireless ADB pairing (Android 11+)
ocloud host add 192.168.1.42:5555 --name pixel9    # records baseline and enrolls device
```

From any machine signed in to the same org, reserve and drive the device like a local phone:

```bash
ocloud devices reserve lab:desk/pixel9
olef -d lab:desk/pixel9 app apply
ocloud devices view lab:desk/pixel9                # hosted browser viewer link
ocloud devices release lab:desk/pixel9
```

When a lease ends, the host automatically resets the device against its enrolled baseline. Unexpected drift quarantines the device until you inspect `ocloud host baseline diff` and run `ocloud host unquarantine`.

See the full CLI reference in [`ocloud host`](https://olef.dev/docs/reference/ocloud/host).
