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

# Port Forwarding

> Using the CLI, you can port-forward deployments to access them securely without having to expose them to the public internet

If you haven't already, install the CLI as documented [here](/cli/overview).

<Frame>
  <div style={{paddingBottom: '56.25%'}} className="relative h-0 w-full overflow-hidden max-w-full">
    <iframe className="absolute top-0 left-0 w-full h-full" src="https://www.youtube.com/embed/HYkgmvlhKkY?modestbranding=1&rel=0" frameBorder="0" allowFullScreen />
  </div>
</Frame>

## Initiate the tunnel

You can open a tunnel between your deployments and local machine via `hop fwd` - then select the local & remote ports to open.

<AccordionGroup>
  <Accordion title="Without hostnames">
    To tunnel your deployment without host entries

    ```bash theme={null}
    hop fwd [deployment_name]
    ```
  </Accordion>

  <Accordion title="With hostnames">
    To add `<name>.hop` to your hosts file, sudo the tunnel in addition to providing the `--hosts` flag.

    ```bash theme={null}
    sudo hop fwd [deployment_name] --hosts
    ```
  </Accordion>
</AccordionGroup>
