> ## Documentation Index
> Fetch the complete documentation index at: https://namespace.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# devbox port-forward

> Forward ports from a Devbox to the local machine.

Use `devbox port-forward` to forward TCP ports from a running Devbox to localhost. Keep the command running while you use the forwarded ports.

## Usage

```bash theme={null}
devbox port-forward [devbox-name] [flags]
```

Without `--ports`, the command forwards ports configured by the Devbox. It exits without forwarding when neither the command nor the Devbox configuration supplies ports.

## Forward matching local and remote ports

```bash theme={null}
devbox port-forward main --ports 3000,8080
```

## Remap a remote port

```bash theme={null}
devbox port-forward main --ports 4000:3000
```

This maps local port `4000` to remote port `3000`.

## Options

<ResponseField name="--ports" type="string">
  Provide a comma-separated list of ports. Use `local:remote` to map different local and remote port numbers.
</ResponseField>

<ResponseField name="--show-all" type="boolean" default="false">
  Include Devboxes owned by other workspace members when selecting a Devbox.
</ResponseField>

## Related topics

<Card title="Remote development" icon="monitor" href="/docs/devbox/remote-development">
  Access services and development tools on a Devbox.
</Card>
