> ## Documentation Index
> Fetch the complete documentation index at: https://catalyst.leifiyo.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Console and lifecycle

> Start, stop, restart, and control server processes from Catalyst.

The server detail overview includes lifecycle controls and a live console. Catalyst starts Java directly, watches output, tracks status, and sends selected events back to the renderer.

## Status states

| State    | Meaning                                                                    |
| -------- | -------------------------------------------------------------------------- |
| Offline  | No managed Java process is running.                                        |
| Starting | Catalyst spawned Java and is waiting for the server to finish booting.     |
| Online   | The console printed the ready message and the server is accepting players. |
| Stopping | Catalyst sent shutdown commands and is waiting for Java to exit.           |
| Crashed  | The Java process exited unexpectedly or startup failed.                    |

## Starting a server

<Steps>
  <Step title="Accept EULA">
    If the server has not accepted the EULA, Catalyst asks for confirmation before writing `eula=true`.
  </Step>

  <Step title="Prepare Java">
    Catalyst uses the server's custom Java path when set. Otherwise it picks a compatible detected or managed runtime.
  </Step>

  <Step title="Spawn Java">
    The process starts with memory flags, G1GC/Aikar-style tuning flags, and `-jar server.jar nogui`.
  </Step>

  <Step title="Watch logs">
    Startup changes to Online when Catalyst sees the normal ready message.
  </Step>
</Steps>

## Console behavior

* Console output is streamed through IPC and kept to a bounded history.
* ANSI colors are rendered in the UI.
* The command box is disabled while the server is offline.
* Commands are sent without a leading slash.
* The exact `restart` command is intercepted so Catalyst can perform an app-managed restart.

<Tip>
  Use Catalyst's restart button for restarts. It preserves the app's state handling and can restart ngrok tunnels when needed.
</Tip>

## Stop and restart

Catalyst stops servers by sending `save-all flush`, then `stop`. If Java does not exit within the timeout, Catalyst kills the process and marks the server offline.

A restart is a stop followed by a fresh start. If ngrok is enabled and configured, the tunnel can be restored after the server returns online.

## Automatic world saves

While a server is online, Catalyst periodically sends `save-all flush` to reduce the risk of world data loss.
