# WithHostPort

- Module: [Aspire.Hosting.Docker](/reference/api/go/aspire.hosting.docker.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`DockerComposeAspireDashboardResource`](/reference/api/go/aspire.hosting.docker/dockercomposeaspiredashboardresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the port used to access the Aspire Dashboard from a browser.

## Definition

```go
func (DockerComposeAspireDashboardResource) WithHostPort(options ...*WithHostPortOptions) DockerComposeAspireDashboardResource
```

## Parameters

- `options` (`...*WithHostPortOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithHostPortOptions` argument.

- `Port` (`*float64`) -- The port to bind on the host. If non-null, the dashboard will be exposed on the host. If `null`, the dashboard will not be exposed on the host but will only be reachable within the container network.

## Returns

[`DockerComposeAspireDashboardResource`](/reference/api/go/aspire.hosting.docker/dockercomposeaspiredashboardresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`DockerComposeAspireDashboardResource`](/reference/api/go/aspire.hosting.docker/dockercomposeaspiredashboardresource.md)
