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

# Use the command line on shared hosting (Terminal and SSH)

> Run commands on your HostCloud hosting account from cPanel's Terminal or from your own computer over SSH.

Some tasks, such as running Composer, WP-CLI or Git, are easier with commands than with clicks. This guide shows you two ways to get a command line on your HostCloud hosting account.

| | Terminal | SSH |
| - | - | - |
| Where it runs | In your browser, inside cPanel | In an app on your own computer |
| Setup | None | Create an SSH key first |
| Best for | Quick jobs | Regular work |

> [!NOTE]
>
> You work inside your own hosting account, not as the server's administrator. You can't install system software or use `sudo`. For full control, use a [HostCloud VPS](https://kb.hostcloud.in/vps/access-your-vps-over-ssh.md).

## Use Terminal in cPanel

**1. Open Terminal**

[Log in to cPanel](https://kb.hostcloud.in/cpanel/log-in-to-cpanel.md), type **Terminal** in the **Search Tools** box and open it.

**2. Accept the warning**

The first time, cPanel warns that commands can change or delete your files. Read it and continue.

**3. Run your commands**

A command line opens in your home folder. Your website files are in `public_html`. For example, type `cd public_html` and press **Enter**, then `ls` to list the files.

## Use SSH from your computer

SSH logs in with a **key**: a pair of matching files. The public key stays on the server. The private key stays on your computer and works like a password.

### Step 1: Create a key in cPanel

**1. Open SSH Access**

In cPanel, type **SSH Access** in the **Search Tools** box and open it. Click **Manage SSH Keys**.

**2. Generate a key**

Click **Generate a New Key**. Give it a name, set a strong passphrase, and click **Generate Key**.

**3. Authorise the key**

Go back to the key list. Under **Public Keys**, click **Manage** next to your new key, then **Authorize**. A key that isn't authorised can't log in.

**4. Download the private key**

Under **Private Keys**, click **View/Download** next to your key and download it. Use the PPK format if you use PuTTY on Windows.

> [!TIP]
>
> Already have a key on your computer? Click **Import Key**, paste your **public** key, then authorise it. Never paste your private key into a website.

### Step 2: Connect

| Setting | Value |
| - | - |
| Server | The server hostname from your hosting welcome email |
| Username | Your cPanel username |
| Port | `22` |
| Key | The private key you downloaded |

On Mac, Linux or Windows 10/11, open a terminal app and run:

```bash theme={null}
ssh -i path/to/your-key -p 22 cpanelusername@server-hostname
```

Replace `path/to/your-key`, `cpanelusername` and `server-hostname` with your own details. Enter your key's passphrase when asked.

> [!WARNING]
>
> Commands run straight away, with no undo. A wrong `rm` can delete your website. [Take a backup](https://kb.hostcloud.in/cpanel/take-and-restore-backups.md) before big changes.

Deploying code from GitHub or GitLab? See [Deploy your website from Git](https://kb.hostcloud.in/cpanel/git-version-control.md).

Still stuck? [Open a ticket](https://kb.hostcloud.in/support/open-a-ticket.md) with your domain name and the exact error you see.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.