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

# Port Forwarding

> Set up port forwarding using the CLI. Map remote instance ports to local endpoints for development, testing, and service access on cloud hardware.

<Columns cols={3}>
  <Card title="VS Code" icon="window" href="/vscode/operations/port-forwarding" color="#95c5ea" className="platform-card">
    Editor extension
  </Card>

  <Card title="CLI" icon="terminal" color="#95c5ea" className="platform-card platform-current">
    Command line
  </Card>

  <Card title="Console" icon="browser" href="/console/operations/port-forwarding" color="#95c5ea" className="platform-card">
    Web interface
  </Card>
</Columns>

<Note>
  Port forwarding is also available through the [VS Code extension](/vscode/operations/port-forwarding) and the [Console](/console/operations/port-forwarding).
</Note>

## How It Works

When you forward a port, your HTTP service becomes available at:

```
https://<instance-uuid>-<port>.thundercompute.net
```

For example, if your instance UUID is `abc123` and you forward port `8080`, your service is accessible at:

```
https://abc123-8080.thundercompute.net
```

All traffic is automatically secured with HTTPS and protected against DDoS attacks

## Forward Ports

### Interactive Mode

Run the command without arguments to use the interactive interface:

```bash theme={null}
tnr ports forward
```

This guides you through selecting an instance and entering the ports you want to forward.

### Using Flags

Add or remove ports directly with flags:

```bash theme={null}
# Forward a single port
tnr ports forward <instance_id> --add 8080

# Forward multiple ports
tnr ports forward <instance_id> --add 8080,3000,5000

# Remove a forwarded port
tnr ports forward <instance_id> --remove 8080

# Add and remove in one command
tnr ports forward <instance_id> --add 3000 --remove 8080
```

## List Forwarded Ports

See all forwarded ports across your instances:

```bash theme={null}
tnr ports list
```

## Limitations

* **Port 22 is reserved** for SSH and cannot be forwarded
* **Valid port range**: 1-65535
* **HTTP only**: Your service must speak HTTP or gRPC, Other protocols like raw TCP or UDP are not currently supported.

## Example: Exposing a Web Server

1. Start a web server on your instance (e.g., on port 8080)
2. Forward the port:
   ```bash theme={null}
   tnr ports forward <instance_id> --add 8080
   ```
3. Access your service at `https://<instance-uuid>-8080.thundercompute.net`
