# PgWebContainerResource.withHostPort

- Module: [Aspire.Hosting.PostgreSQL](/reference/api/typescript/aspire.hosting.postgresql.md)
- Defined on: [PgWebContainerResource](/reference/api/typescript/aspire.hosting.postgresql/pgwebcontainerresource.md)
- Version: `13.4.0`
- Kind: `method`

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

## Definition

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

## Signature

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

## Parameters

- `port` (`number`)

## Returns

[PgWebContainerResource](/reference/api/typescript/aspire.hosting.postgresql/pgwebcontainerresource.md) `builder`

## Defined on

- [PgWebContainerResource](/reference/api/typescript/aspire.hosting.postgresql/pgwebcontainerresource.md) -- `handle`
