---
title: ""
url: "https://docs.yugabyte.com/stable/yugabyte-cloud/cloud-connect/connect/ysql/"
---

# 

To connect to a cluster using ysqlsh:

01. On the **Clusters** tab, select a cluster.
02. Click **Connect**.
03. Click **YugabyteDB Client Shell**.
04. If you have not installed the YugabyteDB clients on your computer, select your operating system and copy the command to install the clients from the command line.
05. Click **Download CA Cert** to download the root.crt certificate for TLS encryption, and install the certificate on your computer. If you are using Docker, copy the certificate to your Docker container.
06. If your cluster is deployed in a VPC, choose **Private Address** if you are connecting from a peered VPC. Otherwise, choose **Public Address** (only available if you have enabled Public Access for the cluster; not recommended for production).
07. Copy the **YSQL** connection string.
    
    The connection string includes flags specifying the host (`host`), username (`user`), database (`dbname`), and TLS settings (`sslmode` and `sslrootcert`). The command specifies that the connection will use the CA certificate you installed on your computer. For information on using other SSL modes, refer to [SSL modes in YSQL](/stable/yugabyte-cloud/cloud-secure-clusters/cloud-authentication/#ssl-modes-in-ysql "SSL modes in YSQL").
    
    Here's an example of the generated ysqlsh command:
    
    ```sh
    ./ysqlsh "host=740ce33e-4242-4242-a424-cc4242c4242b.aws.yugabyte.cloud \
    user=<DB USER> \
    dbname=yugabyte \
    sslmode=verify-full \
    sslrootcert=<ROOT_CERT_PATH>"
    ```
08. On your computer, change directories to the directory where you installed the client shell.
09. Paste and run the command, replacing
    
    - `<DB USER>` with your database username.
    - `yugabyte` with the database name, if you're connecting to a database other than the default (yugabyte).
    - `<ROOT_CERT_PATH>` with the path to the root certificate on your computer.
10. Enter your password when prompted.

The ysqlsh shell opens connected to the remote cluster.

```output
ysqlsh (15.2-YB-2026.1.2.0-b0)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

yugabyte=>
```
