# ocloud host

Source: https://olef.dev/docs/reference/ocloud/host

Generated from **ocloud 3.17.3**. [All ocloud commands](https://olef.dev/docs/reference/ocloud) · [Olef Cloud overview](https://olef.dev/docs/cloud/overview) · [`olef` commands](https://olef.dev/docs/reference/commands)

Run your own Mac or Linux machine as an Olef Cloud workspace and device host

Global options (`--org`, `--project-root`, `--quiet`, `--redact`) apply across commands; see the [`ocloud` command catalog](https://olef.dev/docs/reference/ocloud#global-options).

## ocloud host add

Enrol a device: probe it, record its baseline, offer it in the Cloud. For a network device give `host:port` (Fire TV: `<ip>:5555`); the device asks once to trust the host's adb key

```bash
ocloud host add --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** The device's serial on the host's adb server, or `host:port` for a network device |
| `--name` | **Required.** Its name on the host (`lab:<host>/<name>`) |
| `--timeout-ms` | How long to wait for the device to trust the host's key |

## ocloud host baseline diff

What differs from it now

```bash
ocloud host baseline diff --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** Device name or id |

## ocloud host baseline show

What was recorded at enrolment

```bash
ocloud host baseline show --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** Device name or id |

## ocloud host devices

Devices the host's own adb server sees, enrolled or not

```bash
ocloud host devices --help
```

## ocloud host pair

Pair an Android 11+ device for wireless debugging with the host's adb key (the code and port from Settings › Wireless debugging › Pair)

```bash
ocloud host pair --help
```

| Argument | Description |
| --- | --- |
| `<address>` | **Required.** `host:port` from the pairing dialog |
| `<code>` | **Required.** The six-digit pairing code |

## ocloud host pools

The organization's host pools that run workspaces: free and total slots, whether you may use each, and their hosts. (Manage pool grants with `ocloud grant pool <pool> <principal>` and `ocloud grants pool <pool>`.)

```bash
ocloud host pools --help
```

## ocloud host register

Register this machine as a host with your Olef Cloud account (needs `cloud login`); keeps the host credential under `~/.olef/host/`

```bash
ocloud host register --help
```

| Argument | Description |
| --- | --- |
| `--name` | **Required.** The host's name (letters, digits, '-', '_') |
| `--reset` | What a reset undoes after each lease: `full` (back to the enrolment baseline), `lease_only` (only what the lease installed, created or changed; for devices people also use) or `none` |
| `--adb-port` | The host's adb server port |
| `--force` | Replace an existing host registration on this machine |
| `--pool` | Join this existing pool of the organization (name or id; `host pools` lists them) instead of starting a pool of its own. Needs the lab manager role |
| `--org` | The org it serves (slug or id; default: your current org) |

## ocloud host remove

Stop offering a device and forget it

```bash
ocloud host remove --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** Device name or id |

## ocloud host reset

Ask the Cloud to reset a device now (it must be free)

```bash
ocloud host reset --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** Device name or id |

## ocloud host serve

Run the host agent: tunnel to the Cloud, serve leases and workspace sessions, reset devices

```bash
ocloud host serve --help
```

| Argument | Description |
| --- | --- |
| `--olef` | Path to the companion `olef` binary that workspace agents execute (defaults to `OLEF_BIN`, then sibling `olef` beside `ocloud`, then `PATH`) |

## ocloud host service install

Write the service definition and print the one command (`sudo`) that installs it

```bash
ocloud host service install --help
```

| Argument | Description |
| --- | --- |
| `--agents` | Also create the account agent runs use (never you), let the service act as it and keep it off your adb and emulators |
| `--stay-awake` | Keep this computer awake on power (macOS `pmset -c`; Linux: no sleep while the service runs, the lid ignored on external power) |

## ocloud host service start

Let the installed service run the agent (no `sudo`)

```bash
ocloud host service start --help
```

## ocloud host service stop

Stop the agent and keep the service from restarting it (no `sudo`); its devices go offline in the Cloud

```bash
ocloud host service stop --help
```

## ocloud host service uninstall

Print the command that removes it

```bash
ocloud host service uninstall --help
```

## ocloud host set agents

Whether agents may run here: `on`, `off`, or `default` (on for VM hosts and for native hosts in a personal org)

```bash
ocloud host set agents --help
```

| Argument | Description |
| --- | --- |
| `<agents>` | **Required.** Positional argument. |

## ocloud host set runtime

Whether this host runs workspaces: `none` (devices only), `native` (sessions as processes on this machine) or `vm` (in a VM)

```bash
ocloud host set runtime --help
```

| Argument | Description |
| --- | --- |
| `<runtime>` | **Required.** Positional argument. |

## ocloud host set slots

How many workspace sessions run here at once (1 to 64)

```bash
ocloud host set slots --help
```

| Argument | Description |
| --- | --- |
| `<slots>` | **Required.** Positional argument. |

## ocloud host setup

Make this computer a workspace host in one step: your personal org (or `--org`), workspaces on, the service, staying awake on power, and what could still make it unreachable

```bash
ocloud host setup --help
```

| Argument | Description |
| --- | --- |
| `--name` | The host's name (default: this computer's name) |
| `--org` | The org it serves (name, slug or id; default: your personal org) |
| `--slots` | How many workspace sessions run here at once (default: from memory) |
| `--agents` | Also let managed agents run here, as a dedicated account (never you) |
| `--undo-power` | Put back the power settings setup changed, and stop there |

## ocloud host status

The host, its runtime and slots, its devices and their states

```bash
ocloud host status --help
```

## ocloud host unquarantine

Offer a quarantined device again, once you have checked it (`host status` says why it was quarantined, `host baseline diff` what differs)

```bash
ocloud host unquarantine --help
```

| Argument | Description |
| --- | --- |
| `<lab_device>` | **Required.** Device name or id |

## ocloud host unregister

Stop being a host: remove this computer from its org (its leases end, its sessions stop), forget the registration here and stop the service. Workspace folders stay on disk

```bash
ocloud host unregister --help
```
