> For the complete documentation index, see [llms.txt](https://sealights-docs.tricentis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sealights-docs.tricentis.com/setup-and-configuration/command-line-interface/start-the-agent-server.md).

# Start the ABAP Agent Server

The ABAP Agent server is a local background service that the ABAP Agent CLI and watcher use for server-backed work such as test repository operations, build map stages, and FLPCA import. It runs as the **SeaLights ABAP Server** Windows service (`SLABAPServer`).

## Operator lifecycle

Follow this order when setting up or operating the server:

1. **Install** — After the Windows installer (`SeaLights_ABAP_Agent_Setup.exe`) has copied the agent files, `slabapcli setup install` creates `config.toml` and registers the **SeaLights ABAP Server** Windows service:
   * Internal service name: **`SLABAPServer`**
   * Display name: **SeaLights ABAP Server**
   * Startup type: **Automatic** (set when the service is registered)
   * Service account: **NETWORK SERVICE**
   * Neither the installer nor `setup install` starts the HTTP server process.
2. **Set the SeaLights token** — `slabapcli sealights set`. The token is **cold**: the server reads it when the service starts, so changing it requires a service restart. If the token is missing at start, the server still starts but reports `not_ready`.
3. **First start** — `slabapcli server start`. This is the first time the HTTP server actually runs.
4. **Lab configuration** — Add RFC Destinations, pipelines, test repositories, port, and other settings as needed for your environment.
5. **Automatic on reboot** — Because the service is registered with Automatic startup, it starts in the background after every machine restart, whether or not you have started it yourself yet. If the machine restarts before the token is set, the server starts but reports `not_ready` until you set the token and restart the service.

{% hint style="warning" %}
**Set the token before first start.** Run `slabapcli sealights set` before `slabapcli server start`.
{% endhint %}

Run commands from the agent's `bin` directory (default: `C:\Program Files\Tricentis\SeaLights\ABAP Agent\bin`). Run the terminal as an Administrator.

There is **no** `slabapcli server restart` command. To apply cold configuration changes (including `sealights.token`), run `slabapcli server stop`, then `slabapcli server start`.

You can also start or stop the service with `sc start SLABAPServer` / `sc stop SLABAPServer`, or through Windows Services MMC.

## `slabapcli server start`

Starts the `SLABAPServer` Windows service via SCM. Waits up to **30 seconds** for the service to reach a running state. If the service is already running, the command reports success.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe server start
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe server start
```

{% endcode %}
{% endtab %}
{% endtabs %}

This command takes no parameters.

### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe server start
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe server start
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server start
Waiting up to 30s for the service to start...
Windows service 'SLABAPServer' is running.
```

{% endcode %}

The command exits with code `0` on success and `1` on failure. A failure prints a line that starts with `Error:`, for example:

* The service is not registered. Register it with `slabapcli setup install` (or `slabapcli server install`).
* The service does not reach the running state within 30 seconds: `Error: Timed out waiting for the Windows service to reach the requested state`.
* The service stops while starting: `Error: Service exited while starting (process exit code <n>)`.

For the last two, check the [server log](#server-logs).

## `slabapcli server stop`

Stops the `SLABAPServer` Windows service via SCM. Waits up to **30 seconds** for the service to stop. If the service is not running, the command still reports it as stopped.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe server stop
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe server stop
```

{% endcode %}
{% endtab %}
{% endtabs %}

This command takes no parameters.

### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe server stop
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe server stop
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server stop
Waiting up to 30s for the service to stop...
Windows service 'SLABAPServer' is stopped.
```

{% endcode %}

Exit codes and `Error:` output follow the same pattern as `slabapcli server start`.

## `slabapcli server status`

Probes HTTP **`GET /ready`** on localhost (port from `[server].port` in `config.toml`, default 17500). Reports server readiness — **not** SCM service state. Because it reads the port from `config.toml`, the command needs a valid configuration.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe server status
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe server status
```

{% endcode %}
{% endtab %}
{% endtabs %}

This command takes no parameters.

### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe server status
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe server status
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output when ready (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server status
SLABAPServer is ready.
```

{% endcode %}

{% code title="Expected output when not ready (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server status
SLABAPServer is starting / not ready yet.
```

{% endcode %}

{% code title="Expected output when unreachable (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server status
SLABAPServer is down / unreachable.
```

{% endcode %}

The command exits with code `0` when the server is ready and `1` in every other case (starting, unreachable, or an unexpected response). An unexpected response is reported as `Error: unexpected response from GET /ready.`

{% hint style="info" %}
`slabapcli server status` calls the same readiness endpoint as a manual probe: `GET http://127.0.0.1:17500/ready` (port configurable via `[server].port`). See [Check server readiness](#check-server-readiness) for HTTP response details.
{% endhint %}

## `slabapcli server install`

Registers the **SeaLights ABAP Server** Windows service (`SLABAPServer`) with Automatic startup. Normally performed by `slabapcli setup install`. Requires a `config.toml` with a supported schema version (if the CLI reports otherwise, run `slabapcli setup migrate`) and uses the `SLABAPServer.exe` in the `[settings].install` directory.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe server install
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe server install
```

{% endcode %}
{% endtab %}
{% endtabs %}

This command takes no parameters.

### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe server install
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe server install
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server install
Registered Windows service 'SLABAPServer' -> C:\Program Files\Tricentis\SeaLights\ABAP Agent\bin\SLABAPServer.exe
```

{% endcode %}

The command exits with code `1` and prints an `Error:` line when:

* `SLABAPServer.exe` is not found: `Error: server executable not found: <path>`.
* The service is already registered with a different executable path: `Error: Service 'SLABAPServer' is already registered with a different binary path: <path>`. Run `slabapcli server uninstall`, then install again.

If the service is already registered with the same path, the command succeeds.

## `slabapcli server uninstall`

Unregisters the `SLABAPServer` Windows service. If the service is running, the command stops it first (waiting up to 30 seconds) and then removes it. The command also succeeds when the service is not registered. Use it when re-registering the service manually or during uninstall recovery. It does not need `config.toml`.

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Syntax" overflow="wrap" %}

```batch
slabapcli.exe server uninstall
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Syntax" overflow="wrap" %}

```powershell
.\slabapcli.exe server uninstall
```

{% endcode %}
{% endtab %}
{% endtabs %}

This command takes no parameters.

### Example

{% tabs %}
{% tab title="Command Prompt" %}
{% code title="Command" overflow="wrap" %}

```batch
slabapcli.exe server uninstall
```

{% endcode %}
{% endtab %}

{% tab title="PowerShell" %}
{% code title="Command" overflow="wrap" %}

```powershell
.\slabapcli.exe server uninstall
```

{% endcode %}
{% endtab %}
{% endtabs %}

{% code title="Expected output (PowerShell)" overflow="wrap" lineNumbers="true" %}

```log
.\slabapcli.exe server uninstall
Unregistered Windows service 'SLABAPServer'.
```

{% endcode %}

## Server port

The server binds to `http://127.0.0.1:17500` by default. To change the port, set `[server].port` in `config.toml` and restart the service (`slabapcli server stop`, then `slabapcli server start`). See [Configuration settings](broken://pages/DZM4uWEu5r51kMDWCmDB).

## Server logs

The service writes a daily log at:

```
{userdata}\public\Logs\server-YYYYMMDD.log
```

`{userdata}` is the `[settings].userdata` directory, which defaults to `%ProgramData%\Tricentis\SeaLights\ABAP Agent`.

Use this log for startup failures, readiness issues, and task lifecycle events. See [Configuration settings — Log locations](broken://pages/DZM4uWEu5r51kMDWCmDB#log-locations) and [Troubleshooting](broken://pages/DTAUuyOmlKawT2B8UTYM#server-issues).

## Check server readiness

The server exposes a readiness probe at `GET http://127.0.0.1:17500/ready`. Use this (or `slabapcli server status`) to confirm the server is ready to accept work before running CLI commands or scheduled tasks.

| HTTP status               | Response body                                                         | Meaning                                                                                                                     |
| ------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `200 OK`                  | `{"status":"ready"}`                                                  | Config valid, SeaLights token validated, process database ready.                                                            |
| `503 Service Unavailable` | `{"status":"not_ready", "reasonCode":"CONFIG_RESTART_REQUIRED", ...}` | See [Live reload and restart-required fields](broken://pages/DZM4uWEu5r51kMDWCmDB#live-reload-and-restart-required-fields). |
| `503 Service Unavailable` | `{"status":"not_ready", ...}` (other reasons)                         | Config invalid, token missing or validation failed, or process database unavailable.                                        |

{% hint style="info" %}
You can check readiness from the command line:

```batch
curl http://127.0.0.1:17500/ready
```

Or use `slabapcli server status`, which performs the same probe.
{% endhint %}

If the server returns `not_ready`:

* For `CONFIG_RESTART_REQUIRED`, restart the service: `slabapcli server stop`, then `slabapcli server start`. See [Live reload and restart-required fields](broken://pages/DZM4uWEu5r51kMDWCmDB#live-reload-and-restart-required-fields).
* Verify that `slabapcli sealights set` has been run and the token is valid (`slabapcli sealights test`). The server reads the token when the service starts, so restart the service after setting or changing it.
* Verify `config.toml` has no syntax errors (`slabapcli setup status`).
* Check the [server log](#server-logs) at `{userdata}\public\Logs\server-YYYYMMDD.log`.
