---
title: "opod up, down, status"
description: "Start a leader, a front door or a cell door; stop the local leader; and check what is running."
url: "https://opod.io/docs/core-cli/up/"
markdown_url: "https://opod.io/docs/core-cli/up.md"
section: "Core CLI"
last_updated: "2026-10-30"
---

# opod up, down, status

> Start a leader, a front door or a cell door; stop the local leader; and check what is running.

## In short

`opod up` starts a leader on this machine: the OpenAI-compatible gateway on `:8080`, the router, the keys and the admin API. With `--role gateway` it starts a front door for a leader, and with `--role door` a cell door for many leaders. `opod down` stops it and `opod status` shows it.

```bash
opod up
opod status
opod down
```

## opod up

Start the local node. On first run it becomes the cluster leader.

```text
opod up [--config PATH] [--auto-pull=false] [--no-wizard] [--exclusive] [--unload-on-exit]
        [--role gateway --leader URL] [--role door --routes FILE]
```

| Flag               | Default                 | Effect                                                                                                                                                                                          |
| ------------------ | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--config PATH`    | `~/.opod/config.yaml`   | The config file to read.                                                                                                                                                                        |
| `--auto-pull`      | `true`                  | Allow the first run to pull the default model (`opod up --help` on 0.2.1 wrongly says it is off by default). Applies only when `router.pull_default_model` (`OPOD_PULL_DEFAULT_MODEL=1`) is on. |
| `--no-wizard`      | `false`                 | Skip the interactive first-run prompt. With `--auto-pull=false`, the start is fully quiet.                                                                                                      |
| `--exclusive`      | `false`                 | One resident model per machine: a load evicts every other non-pinned model first. Same as `placement.exclusive` or `OPOD_EXCLUSIVE=1`.                                                          |
| `--unload-on-exit` | `OPOD_UNLOAD_ON_EXIT=1` | On Ctrl-C, ask the engine to drop loaded models from memory.                                                                                                                                    |
| `--role ROLE`      | `leader`                | `leader`, `gateway` or `door`. `OPOD_ROLE` also sets it. A flag wins over the variable.                                                                                                         |
| `--leader URL`     | —                       | The leader a `gateway` mirrors and pushes to, e.g. `http://leader:8080`. `OPOD_LEADER_URL` also sets it.                                                                                        |
| `--routes FILE`    | —                       | The routes file a `door` watches. `OPOD_DOOR_ROUTES` also sets it.                                                                                                                              |

```bash
opod up
OPOD_PULL_DEFAULT_MODEL=1 OPOD_DEFAULT_MODEL=llama-3.2-1b opod up   # this machine serves a model too
OPOD_ENGINE=llamacpp OPOD_PULL_DEFAULT_MODEL=1 opod up               # launches llama-server if none runs
opod up --config ~/.opod/staging.yaml
opod up --role gateway --leader http://leader:8080
opod up --role door --routes /etc/opod-door/routes.json
```

### What a leader does at start

1. Loads the config: defaults, then the YAML file, then environment variables.
2. Detects the hardware and prints it.
3. Opens the store (`storage.dsn`, default `~/.opod/state.db`; in memory when `OPOD_MANAGED=1` and `OPOD_STORAGE_DSN` is unset).
4. On the first standalone run, mints an admin key, prints it once and saves it to `~/.opod/admin.key`. Seeds `auth.join_token` and `auth.admin_token` as keys when they are set.
5. Loads the catalog. With no `router.default_model`, picks one that fits the hardware.
6. Probes the engine for 3 seconds. With `engine.preferred: llamacpp`, `pull_default_model` on and nothing on the llama.cpp endpoint, it launches `llama-server -hf <repo>` for the default model.
7. Registers itself as node `local`.
8. With `pull_default_model` on and a reachable engine, runs the first-run prompt or pulls the default model.
9. Writes its PID to `<data_dir>/opod.pid`, prints the ready block and starts serving. From core v0.4.6, the PID file and the ready block (with the admin key shown once) come only after the port is bound, so a failed start prints no "ready" and no key.
10. Restores the models that were loaded or pinned before the last shutdown, in the background.

The ready block lists the API URL, the health URL, the mode (`standalone` or `managed`) and every outbound call this node is configured to make.

There is no check for an already-running leader: a second `opod up` on the same port fails with `address already in use`.

From core v0.4.6, `opod up` checks before it starts anything:

| Case                                                                                     | What it prints                                                                                                        | Exit |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ---- |
| a leader already runs from this data directory (its PID is alive and `/healthz` answers) | `already running (pid N, http://localhost:8080) — stop it with opod down, or see it with opod status`                 | `1`  |
| the port is taken by another program                                                     | `port :8080 is in use — another program listens there; stop it, or set listen: in ~/.opod/config.yaml or OPOD_LISTEN` | `1`  |
| `--role gateway` with no `--leader` / `OPOD_LEADER_URL`                                  | `--role gateway needs --leader <url> (or OPOD_LEADER_URL) …`, the usage line                                          | `2`  |
| `--role door` with no `--routes` / `OPOD_DOOR_ROUTES`                                    | `--role door needs --routes <file> …`, the usage line                                                                 | `2`  |
| `--role door` whose routes file is not there yet                                         | a warning — every model answers 404 until the file appears; the door re-reads it every 10 s                           | runs |

A container that restarts in place may find a PID file that names itself; that is not a second leader, and `opod up` goes on.

### Roles

- **`leader`**: the full process described above.
- **`gateway`**: a front door for one leader's endpoint. It serves `/v1` and the probes only; no `/admin/v1`, no join surface, no engine. It mirrors the leader's worker list (and, from core v0.4.0, keeps every worker it knows while a restarted leader is still rebuilding that list), pushes its usage rows to the leader and polls the leader every 10 seconds for the door count. It needs `--leader` and an admin key in `OPOD_ADMIN_TOKEN`. It fails at start when it cannot reach its leader.
- **`door`**: one URL for many endpoints. It opens no store, starts no engine and holds no key. It reads each request's `model`, finds the endpoint in the routes file (re-read every 10 seconds) and forwards the request unchanged.

See [Front doors](https://opod.io/docs/core-reference/front-doors/).

### Signals

`SIGINT` or `SIGTERM` stops the leader. It finishes in-flight HTTP requests (up to 30 seconds), flushes traces and logs, and stops engines it launched. It does not unload models from a separate engine unless `--unload-on-exit` is set.

## opod down

Stop the local leader and release engine memory.

```text
opod down [--no-unload]
```

| Flag          | Effect                               |
| ------------- | ------------------------------------ |
| `--no-unload` | Leave models resident in the engine. |

`opod down` reads `<data_dir>/opod.pid`, sends `SIGTERM` and waits up to 10 seconds for the process to exit. Then it asks the configured engine to unload every resident model. Engines with no unload call (vLLM, MLX-LM) are skipped with a note. A stale PID file is removed and reported.

`opod down` stops a process started with `opod up`. Stop a worker (`opod join`) with Ctrl-C or `SIGTERM`.

From core v0.4.6, `opod down` signals the PID only when it is opod (or answers as this host's leader), and says what it did:

| Case                       | What it prints                                                                                     | Exit |
| -------------------------- | -------------------------------------------------------------------------------------------------- | ---- |
| no PID file                | `opod is not running on this host (no PID file at …) — nothing to stop`                            | `0`  |
| the PID is not running     | `pid N is not running — removed the stale PID file …; nothing to stop`                             | `0`  |
| the PID is another program | `pid N in … is not opod (it is "sleep") — removed the stale PID file; nothing stopped` (on stderr) | `0`  |
| stopped                    | `stopping opod (pid N)…`, then `opod (pid N) stopped`                                              | `0`  |
| still running after 10 s   | `pid N is still running after 10s — check opod status; force it with kill -9 N` (on stderr)        | `1`  |

Before, it sent `SIGTERM` to whatever the PID file named and failed with exit `1` when nothing ran.

## opod status

Show the local leader, its engine and the installed models.

```text
opod status [--json]
```

It calls `GET /healthz` on `http://localhost<listen>` (3-second timeout), probes the engine and lists the models in the store. It exits `1` when the leader does not answer.

```json
{
  "control_plane": { "url": "http://localhost:8080/healthz", "reachable": true, "status": "200 OK" },
  "engine": { "name": "ollama", "endpoint": "http://127.0.0.1:11434", "reachable": true },
  "models": [ { "id": "llama-3.2-1b", "status": "ready", "source": "ollama:llama3.2:1b" } ]
}
```

In this output `control_plane` means the local leader.

From core v0.4.6, `opod status` reports a leader as healthy only on a `2xx` (a `401` or `503` used to print ✔ and exit `0`), checks the engine whether or not the leader answers, and reads the models and nodes from the leader's admin API instead of this host's store (so it no longer creates `state.db`). Without an admin key here it says so on stderr. Warnings go to stderr, and it exits `1` unless the leader is healthy. The JSON names the leader `leader`:

```json
{
  "leader": { "url": "http://localhost:8080/healthz", "reachable": true, "healthy": true, "status": "200 OK" },
  "engine": { "name": "ollama", "endpoint": "http://127.0.0.1:11434", "reachable": true },
  "models": [ { "id": "llama-3.2-1b", "status": "ready", "source": "ollama:llama3.2:1b" } ],
  "nodes": [ { "id": "local", "state": "ready" } ]
}
```

`list_error` appears instead of the lists when the leader could not be asked (no admin key, or a refusal).
