> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# server.host

- **Type:** `string | boolean`
- **Default:** `localhost`

Specify the host that the Rsbuild server listens to.

By default, the Rsbuild server listens on `localhost`. You can configure it in the following ways:

- `string`: specify a hostname or IP address to listen on.
- `true`: equals to `0.0.0.0`, listen on all IPv4 interfaces.
- `false`: equals to `localhost`.

## All IPv4 interfaces

To listen to all IPv4 network interfaces (including public network addresses), set it to `0.0.0.0` or `true`:

```ts title="rsbuild.config.ts"
export default {
  server: {
    host: '0.0.0.0',
  },
};
```

Alternatively, you can use the [--host](/guide/basic/cli.md#specifying-host) CLI flag to enable network access on demand:

```bash
rsbuild --host
```

:::tip
The priority of `--host` CLI option is higher than `server.host`.
:::

## IPv6 Support

If you want the Rsbuild server to listen all IPv6 network interfaces, you can set it to:

```ts title="rsbuild.config.ts"
export default {
  server: {
    host: '::',
  },
};
```

If you want the Rsbuild server to listen a specified IPv6 host, you can set it to:

```ts title="rsbuild.config.ts"
export default {
  server: {
    host: '::1',
  },
};
```

At this point, you can access the page via `http://[::1]:3000/`.

## Network interface names

When Rsbuild listens on all IPv4 interfaces and detects multiple network addresses, the default startup log displays the corresponding network interface names in parentheses. This helps distinguish addresses from Wi-Fi, VPN, Docker, or other network interfaces:

```text
  ➜  Local:    http://localhost:3000/
  ➜  Network:  http://192.0.2.10:3000/     (xray_tun)
  ➜  Network:  http://198.51.100.20:3000/  (Wi-Fi)
```

When only one network address is available, its interface name is omitted.

## Version history

| Version | Changes                                                                             |
| ------- | ----------------------------------------------------------------------------------- |
| v2.0.0  | Default value changed from `0.0.0.0` to `localhost`, add support for `boolean` type |
