# PgAdminContainerResource.WithHostPort

- Module: [Aspire.Hosting.PostgreSQL](/reference/api/go/aspire.hosting.postgresql.md)
- Defined on: [PgAdminContainerResource](/reference/api/go/aspire.hosting.postgresql/pgadmincontainerresource.md)
- Version: `17.0.0`
- Kind: `method`

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

## Definition

```go
type PgAdminContainerResource interface {
    // ... omitted for brevity
    WithHostPort(port *float64) PgAdminContainerResource
}
```

## Signature

```go
WithHostPort(port *float64) PgAdminContainerResource
```

## Parameters

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

## Returns

[`PgAdminContainerResource`](/reference/api/go/aspire.hosting.postgresql/pgadmincontainerresource.md) -- The resource builder for PGAdmin.

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

## Defined on

- [PgAdminContainerResource](/reference/api/go/aspire.hosting.postgresql/pgadmincontainerresource.md) -- `handle`
