Starting and Stopping the Server
The hoziron-cli CLI is an HTTP client — it never launches, embeds, or stops the
server itself. The server is a separate binary, hoziron-server, run
directly by the operator (foreground, systemd, or a container entrypoint).
Starting the server
Synopsis
hoziron-server [--config <path>] [--surfaces <list>] [--api-listen <addr>] \
[--registry-listen <addr>] [--mcp-listen <addr>] [--dashboard-listen <addr>]
Flags
| Flag | Description |
|---|---|
--config <path> | Path to config.toml (default: $HOZIRON_HOME/config.toml) |
--surfaces <list> | Comma-separated surfaces to enable (api,registry,mcp,dashboard), overriding each surface's enabled flag in config |
--api-listen <addr> | Override the API surface's listen address |
--registry-listen <addr> | Override the registry surface's listen address |
--mcp-listen <addr> | Override the MCP surface's listen address |
--dashboard-listen <addr> | Override the dashboard surface's listen address |
Listen Address Resolution
Per surface, priority order (first match wins):
- The surface's
--*-listenCLI flag (e.g.--api-listen) [surfaces.<surface>].listeninconfig.toml- Built-in default (
127.0.0.1:4200for the API surface; see config.toml reference for the others)
There is no HOZIRON_LISTEN environment variable — set the address via the CLI flag or config file.
Examples
# Start with defaults from config.toml (foreground)
$ hoziron-server
INFO Starting Hoziron server surfaces=["api"]
# Start on all interfaces (containers, remote access)
$ hoziron-server --api-listen 0.0.0.0:4200
# Enable multiple surfaces explicitly
$ hoziron-server --surfaces api,registry
# Start with custom config
$ hoziron-server --config /opt/hoziron/config.toml
# Start with verbose logging
$ HOZIRON_LOG=debug hoziron-server
# Start in the background (dev only — prefer systemd/Docker in production)
$ hoziron-server &
What Happens on Start
- Loads configuration from
$HOZIRON_HOME/config.toml(or--config) - Boots the shared
HozironPlatform(execution kernel + data directory) - Registers configured providers (validates API key env vars exist)
- Refuses to boot any surface whose auth is effectively disabled on a non-loopback bind (see Authentication setup)
- Binds each enabled surface to its resolved listen address
Connecting the CLI to a running server
hoziron-server does not write a connection-discovery file — point the CLI
at it explicitly with a context:
hoziron-cli context add local --url http://127.0.0.1:4200
hoziron-cli context use local
hoziron-cli health
See context.md for remote/multi-instance setups.
Stopping the server
There is no hoziron-cli stop command. Stop the hoziron-server process the
same way you'd stop any long-running service:
# Foreground: Ctrl+C (SIGINT)
# Background/systemd
sudo systemctl stop hoziron
# By PID
kill <pid>
# Docker
docker stop <container>
Graceful Shutdown Sequence
hoziron-server handles both SIGINT (Ctrl+C) and SIGTERM:
- Stops accepting new HTTP requests
- Suspends running agents (preserves state)
- Flushes memory stores to SQLite
- Closes database connections
- Exits with code 0
Notes
- Give the process at least 30 seconds between SIGTERM and a hard kill to allow the flush to complete — systemd's default 90s stop timeout is more than sufficient
See Also
- init.md — Initialize before first start
- context.md — Point the CLI at a running server
- utilities.md — Check if the server is reachable
- utilities.md — View server status