# RedisCommanderResource.withHostPort

- Module: [Aspire.Hosting.Redis](/reference/api/typescript/aspire.hosting.redis.md)
- Defined on: [RedisCommanderResource](/reference/api/typescript/aspire.hosting.redis/rediscommanderresource.md)
- Version: `13.4.0`
- Kind: `method`

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

## Definition

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

## Signature

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

## Parameters

- `port` (`number`)

## Returns

[RedisCommanderResource](/reference/api/typescript/aspire.hosting.redis/rediscommanderresource.md) `builder`

## Defined on

- [RedisCommanderResource](/reference/api/typescript/aspire.hosting.redis/rediscommanderresource.md) -- `handle`
