# ngrok

How to leverage ngrok for testing WarpStream Agents running locally.

[ngrok](https://ngrok.com/) is a useful tool to enable services running in the cloud to connect to WarpStream Agents running locally for development purposes.

### Install ngrok

Follow the [ngrok installation instructions](https://dashboard.ngrok.com/get-started/setup).

### Run ngrok locally

Run `ngrok tcp 9092`&#x20;

![](../../../../assets/docs/screenshot-2025-07-28-at-3-00-34-pm.png)

### Run the WarpStream Agent

Run the following command:

```bash wrap
WARPSTREAM_DISCOVERY_KAFKA_HOSTNAME_OVERRIDE=2.tcp.ngrok.io WARPSTREAM_DISCOVERY_KAFKA_PORT_OVERRIDE=12023 warpstream agent \
    -bucketURL file:///tmp \
    -agentKey aks_XXXXXXXXXX \
    -region us-east-1 \
    -defaultVirtualClusterID vci_XXXXXXXXXX
```

Note that the values of `WARPSTREAM_DISCOVERY_KAFKA_HOSTNAME_OVERRIDE` and `WARPSTREAM_DISCOVERY_KAFKA_PORT_OVERRIDE` need to match the address and port from the "Forwarding" section of the previous step.

### Confirm Connectivity

Run the following command:

```bash wrap
warpstream cli diagnose-connection -bootstrap-host 2.tcp.ngrok.io -bootstrap-port 12023
```

Note that the value of -bootstrap-host and -bootstrap-port must match the values from the "Forwarding" section of the "Run ngrok locally" step.

If everything is working correctly, you should see output like this:

```bash
running diagnose-connection sub-command with bootstrap-host: 8.tcp.ngrok.io and bootstrap-port: 13067


Broker Details
---------------
  2.tcp.ngrok.io:12023 (NodeID: 1492894352) [warpstream-unset-az]
    ACCESSIBLE ✅


GroupCoordinator: 2.tcp.ngrok.io:12023 (NodeID: 1492894352)
    ACCESSIBLE ✅
```