Start
Start the embedded NATS server.
The server makes the streams, consumers and KV buckets that the job system
needs. osapi start runs the same server, together with the controller and an
agent, in one process. Use this command to run the bus as its own process. The
nats.server section of the config sets the host, the port and the
authentication. Refer to 2. NATS.
osapi nats start
Examples
osapi nats start
Result
The command prints:
$ osapi nats start 10:00AM INF nats server started successfully component=nats 10:00AM INF embedded NATS server running component=nats host=localhost port=4222 store_dir=.nats/jetstream/ namespace=osapi auth.type=none 10:00AM INF metrics server started component=nats subsystem=metrics addr=0.0.0.0:9092 10:00AM INF http(s) server started component=nats subsystem=metrics address=[::]:9092 10:00AM INF registered in component registry component=nats subsystem=nats.heartbeat hostname=web-03 type=nats key=nats.web-03
With --json, the command prints:
{"time":"2026-01-15T10:00:00Z","level":"INFO","msg":"nats server started successfully","component":"nats"}
{"time":"2026-01-15T10:00:00Z","level":"INFO","msg":"embedded NATS server running","component":"nats","host":"localhost","port":4222,"store_dir":".nats/jetstream/","namespace":"osapi","auth.type":"none"}
{"time":"2026-01-15T10:00:00Z","level":"INFO","msg":"metrics server started","component":"nats","subsystem":"metrics","addr":"0.0.0.0:9092"}
{"time":"2026-01-15T10:00:00Z","level":"INFO","msg":"http(s) server started","component":"nats","subsystem":"metrics","address":"[::]:9092"}
{"time":"2026-01-15T10:00:00Z","level":"INFO","msg":"registered in component registry","component":"nats","subsystem":"nats.heartbeat","hostname":"web-03","type":"nats","key":"nats.web-03"}
Global flags
| Flag | Description | Default |
|---|---|---|
-d, --debug | Enable or disable debug mode | |
-j, --json | Enable JSON output | |
-f, --osapi-file | Path to config file; without one at the default path, osapi runs on the defaults | /etc/osapi/osapi.yaml |
Output tells how the result is printed, and what --json gives.