# DbGateContainerResource.withHostPort

- Module: [CommunityToolkit.Aspire.Hosting.DbGate](/reference/api/typescript/communitytoolkit.aspire.hosting.dbgate.md)
- Defined on: [DbGateContainerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md)
- Version: `13.4.0`
- Kind: `method`

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

## Definition

```typescript
interface DbGateContainerResource {
  // ... omitted for brevity
  withHostPort(port: number): DbGateContainerResource;
}
```

## Signature

```typescript
withHostPort(port: number): DbGateContainerResource
```

## Parameters

- `port` (`number`)

## Returns

[DbGateContainerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md) `builder`

## Defined on

- [DbGateContainerResource](/reference/api/typescript/communitytoolkit.aspire.hosting.dbgate/dbgatecontainerresource.md) -- `handle`
