# Fix "The WebSocket handshake failed" in Terminal
Source: https://docs.webgee.com/en/hosting/the-websocket-handshake-failed-when-using-the-cpanel-terminal



cPanel's **Terminal** shows:

```
Error: The WebSocket handshake failed
```

Applies to shared, reseller and Premium hosting.

## Why it happens [#why-it-happens]

Terminal needs a **WebSocket** connection, which is a long-lived upgraded HTTP
connection rather than an ordinary request.

Reaching cPanel through a proxy subdomain such as `https://cpanel.example.com`
routes that connection through the web server, which does not pass the upgrade
through. The page loads; the terminal cannot connect.

## Use a direct address instead [#use-a-direct-address-instead]

Any of these connect to cPanel directly:

| Address                        | Notes                                        |
| ------------------------------ | -------------------------------------------- |
| `https://example.com:2083`     | Port 2083 is cPanel directly. Most reliable  |
| `https://server-hostname:2083` | Works even if the domain does not point here |
| `https://example.com/cpanel`   | Usually works                                |

Sign in again at one of those and open Terminal.

<Callout type="info">
  If you are behind Cloudflare, use the **server hostname** on port 2083.
  Cloudflare does not proxy port 2083, so the connection goes straight to the
  server — and Cloudflare's own proxy is a second thing that can interfere with
  WebSockets.
</Callout>

## If it still fails [#if-it-still-fails]

* **A corporate network blocking port 2083.** Try another connection.
* **A browser extension interfering.** Test in a private window with extensions
  disabled.
* **Shell access not enabled** on the account. Terminal requires it — see
  [Connect over SSH](/en/development/connect-via-ssh).

## Or just use SSH [#or-just-use-ssh]

Terminal is convenient but limited — no clipboard integration, and the session
ends with the page. For anything substantial, connect over SSH from your own
machine instead: [Connect over SSH](/en/development/connect-via-ssh).

## Related [#related]

* [Connect over SSH](/en/development/connect-via-ssh)
* [Your IP address has changed](/en/hosting/your-ip-address-has-changed-please-log-in-again-cpanel)
