# Local mode (/studio/local-mode)

Local mode runs one robot for a viewer on your own machine, with no cloud in the path. It's the lowest-latency way to work with a robot you can reach directly, and nothing is exposed to the network.

```bash
openhorizon local --g1 --iface eth0
```

This is `serve` with the local-only contract **baked in and unremovable**: one robot, bound to `127.0.0.1` only, not announced, and with relay and headset turned off. The command prints the exact tunnel line for a viewer on another machine.

## What it guarantees [#what-it-guarantees]

- **This computer only.** Bound to `127.0.0.1`; no other machine on the network can reach it.
- **No relay, no headset.** `--relay`, `--remote` and a non-loopback `--host` are refused.
- **Only our pages.** The server checks the browser origin, so a stranger's web page you happen to have open cannot reach it.

## Watch it from another machine [#watch-it-from-another-machine]

Local mode never opens a network port. To view it from another computer, forward the port over your **own** secure tunnel (SSH or Tailscale), then point the app at it:

```bash
ssh -L 9090:127.0.0.1:9090 you@the-robot-computer
```

Then, in the app, **Connect by address** to `localhost:9090`.

<Callout type="info" title="localhost:9090 is the robot's API">
Opening `http://localhost:9090` in a browser shows `{"detail":"Not Found"}` — that port is the robot's API, not a web page. You connect the **app** to it by address; you don't browse the port.
</Callout>

## Operating locally [#operating-locally]

`openhorizon local --g1 --execute` lets the app steer the robot, safely: the origin lock means only your own pages on your own machine can drive it. A person must still be beside the robot with its stop.

## Local vs the relay [#local-vs-the-relay]

| | Local mode | Through the [relay](/studio/pair-a-robot) |
| --- | --- | --- |
| Reach | Your machine / your own tunnel | Anywhere, any network |
| Robots | One | Your team's, many |
| Needs a plan | No | Yes |
| Latency | Lowest | A hop through the relay |