# Config server in the UI

This guide shows how to connect the protect UI to a running configuration server and managed gateway. It assumes you have the fleet running from the [CLI walkthrough](/protect/1.0/config-server.md#walkthrough).

## Starting the UI

Generate a minimal UI config with no pre-configured gateway connections.

```
$ protect ui setup ./ui
```

```
$ protect ui start -c ui/config.yaml
```

## Connecting to the configuration server

Navigate to **Connect** in the sidebar. Enter the config server's external NATS URL with API account credentials:

| Field         | Value                           |
| ------------- | ------------------------------- |
| `Type`        | `Config Server`                 |
| `URL`         | `nats://localhost:4333`         |
| `Auth Type`   | Username / Password             |
| `Username`    | `api`                           |
| `Password`    | `api`                           |
| `Signer Key`  | contents of `bundle-signer.nk`  |
| `Metrics URL` | `http://localhost:8181/metrics` |

![Connect to config server](/assets/images/ui-cs-57-ab871a6148b7bf08e0f551620f365aba.png)

Click **Connect**. The config server appears in Gateways:

![Config server connected](/assets/images/ui-cs-58-007aa52aa11ac2400ca779a222482c80.png)

## Switching between gateways

The gateway selector dropdown lets you switch between the config server and managed gateways in the fleet:

![Gateway selector](/assets/images/ui-cs-60-5e967f239df1822d3ab9daceb91adc03.png)

Selecting `gw` shows the managed gateway's view. However, viewing live gateway details (connections, stats) requires a direct connection to the gateway's management API.

## Connecting to the managed gateway

To get full visibility into a managed gateway, add a second connection on the **Connect** page pointing to the gateway's embedded management port:

| Field         | Value                           |
| ------------- | ------------------------------- |
| `URL`         | `nats://localhost:4911`         |
| `Auth Type`   | NKey (or JWT + NKey)            |
| `NKey Seed`   | contents of `admin.nk`          |
| `Signer Key`  | contents of `bundle-signer.nk`  |
| `Metrics URL` | `http://localhost:8080/metrics` |

![Managed gateway connect](/assets/images/ui-cs-64-eb8818f574c1273b9ad00e461405e440.png)

Now selecting `gw` in the Overview's gateway dropdown shows full gateway details including loaded rules:

![Gateway view with rules](/assets/images/ui-cs-65-f27ff648c5f5c3ec2ba4e2e209e445c2.png)

The gateway shows the `mybundle@1.0.0` rules that were deployed via the config server and automatically mirrored to the managed gateway.

## Summary

The UI supports two connection patterns for fleet management:

| Connection                                | Purpose               | What you can see                                    |
| ----------------------------------------- | --------------------- | --------------------------------------------------- |
| Config server (`nats://localhost:4333`)   | fleet management      | fleet status, bundle management, trace profiles     |
| Managed gateway (`nats://localhost:4911`) | direct gateway access | live connections, stats, gateway info, loaded rules |

Both connections can be active simultaneously, and the gateway selector lets you switch between views.

Once connected, bundle management, trace profiles, and connection management work the same as with a standalone gateway — see the [bundles UI](/protect/1.0/bundles/ui.md), [traces UI](/protect/1.0/traces/ui.md), and [inspecting](/protect/1.0/inspecting.md) docs.
