# WithHostPort

- Module: [CommunityToolkit.Aspire.Hosting.Dbx](/reference/api/go/communitytoolkit.aspire.hosting.dbx.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`DbxContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.dbx/dbxcontainerresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Configures the host port that the dbx resource is exposed on instead of using randomly assigned port.

## Definition

```go
func (DbxContainerResource) WithHostPort(port *float64) DbxContainerResource
```

## Parameters

- `port` (`*float64`) -- The port to bind on the host. If `null` is used random port will be assigned.

## Returns

[`DbxContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.dbx/dbxcontainerresource.md) -- The resource builder for dbx.

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

## Applies to

- [`DbxContainerResource`](/reference/api/go/communitytoolkit.aspire.hosting.dbx/dbxcontainerresource.md)
