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

# Network

> The ports that a Self-Hosted Uplink instance listens on, the connections that it opens, and how to secure the OpenTelemetry listener.

Uplink opens every connection to Agent Golf, and Agent Golf never connects to Uplink. Inbound traffic comes only from your harnesses, your monitoring, and, when the local API is on, the browsers of your users.

## Firewall rules

| Direction | Port | Peer | Purpose |
| - | - | - | - |
| Inbound | 4318 | The machines where your harnesses run | OTLP over HTTP, or HTTPS with TLS on. |
| Inbound | 4317 | The machines where your harnesses run | OTLP over gRPC, from Uplink 0.1.43, when the gRPC listener is on. With TLS on, the listener uses TLS. |
| Inbound | 9090 | The browsers of dashboard users, or your proxy | The [local API](https://docs.agent.golf/uplink/local-api.md), when it is on. The port is your choice, except with the Helm chart. |
| Outbound | 443 | `api.agent.golf` | The Uplink key exchange, credential renewal, the address of the data connection, usage totals, and, when the local API is on, the key set that checks dashboard credentials. |
| Outbound | 7422 | The Agent Golf data connection | One TLS connection for session data, attribution evidence, and health reports. |

Uplink gets the address of the data connection from the Agent Golf API, so allow outbound TCP to port 7422. If your firewall needs host names, contact [support@agent.golf](mailto:support@agent.golf).

If you send the logs and traces of Uplink to your own collector, also allow that connection. See [Monitoring](https://docs.agent.golf/uplink/monitoring.md#send-logs-and-traces-to-your-collector).

## Listeners and default binds

| Listener | Port | Binary | Container image | Helm chart |
| - | - | - | - | - |
| OpenTelemetry (OTLP) | 4318 | `127.0.0.1` | All interfaces | All interfaces. The Service exposes it. |
| OpenTelemetry (OTLP) over gRPC | 4317 | Off | All interfaces | All interfaces. The Service exposes it. |
| Admin: `/healthz`, `/readyz`, `/metrics` | 4319 | `127.0.0.1` | All interfaces | `127.0.0.1`. With `metrics.enabled`, all interfaces, but the Service does not expose it. |
| Local API | Your choice | Off | Off | All interfaces, port 9090. The Service exposes it. |

Uplink also binds internal ports for its own engines on `127.0.0.1` only: port 4222 and one random port. They need no firewall rule. If port 4222 is in use on the host, set [`UPLINK_NATS_PORT`](https://docs.agent.golf/uplink/configuration#startup-shutdown-and-memory) to a free port, or to `-1` for a random port.

The binary starts the gRPC listener only when `OTLP_GRPC_PORT` is set, and binds it to `OTLP_GRPC_HOST`, by default `127.0.0.1`. It uses the TLS settings of the HTTP listener. OTLP over HTTP with Protobuf stays the recommended protocol.

For the settings of each listener, see [Configuration](https://docs.agent.golf/uplink/configuration.md#opentelemetry-listener).

## Secure the OpenTelemetry listener

The OTLP listeners do not authenticate requests. Any host that can reach port 4318, or port 4317 when the gRPC listener is on, can send telemetry to Uplink.

* Keep ports 4318 and 4317 on a private network, such as your VPC or VPN. Never expose them to the internet.
* Allow port 4318 only from the subnets of your developer machines, CI runners, and workstations.
* Turn on TLS for traffic from other hosts. Set `OTLP_TLS_CERT_FILE` and `OTLP_TLS_KEY_FILE` to the PEM certificate chain and key, or set `otlp.tls.existingSecret` in the Helm chart. If your certificate is not publicly trusted, give the harnesses the CA bundle.
* The binary binds loopback by default, so only harnesses on the Uplink host can reach it. To accept harnesses on other hosts, set `OTLP_HTTP_HOST`, and `OTLP_GRPC_HOST` for the gRPC listener, for example to `0.0.0.0`. Without TLS, Uplink then logs the warning `OTLP listener accepts plain unauthenticated HTTP beyond loopback; restrict network access or set OTLP_TLS_CERT_FILE and OTLP_TLS_KEY_FILE`.
* In Docker, publish the listeners as `-p 127.0.0.1:4318:4318 -p 127.0.0.1:4317:4317` to keep them on the loopback of the host.
* In Kubernetes, set `networkPolicy.enabled` and `networkPolicy.otlpFrom` in the Helm chart to admit only your harness sources to ports 4318 and 4317. Your network plugin must enforce NetworkPolicy.

Without TLS, the harness sends its publishing key in plain text. The dashboard warns about such an endpoint, and `agentgolf harness setup` needs `--allow-insecure-endpoint` for it.

## Secure the admin listener

The admin listener has no authentication. Keep it on loopback and scrape it with an agent on the same host. The container image binds it on all container interfaces, so publish port 4319 only on the loopback of the host, as `-p 127.0.0.1:4319:4319`, or do not publish it.

In the Helm chart, `metrics.enabled` binds the admin listener on all pod interfaces and adds `prometheus.io` scrape annotations to the pod. With `networkPolicy.enabled`, add your scraper to `networkPolicy.metricsFrom`. An empty list admits no peer to port 4319.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.