[Yandex Cloud documentation](../index.md) > [Yandex Managed Service for Valkey™](index.md) > Getting started

# Getting started with Yandex Managed Service for Valkey™

To get started:


1. [Create a cluster](#cluster-create).
1. [Connect to the cluster](#connect).



## Getting started {#before-you-begin}

1. Navigate to the [management console](https://console.yandex.cloud) and log in to Yandex Cloud or sign up if not signed up yet.

1. If you do not have a folder yet, create one:

   1. In the [management console](https://console.yandex.cloud), in the top panel, click ![image](../_assets/console-icons/layout-side-content-left.svg) or ![image](../_assets/console-icons/chevron-down.svg) and select the [cloud](../resource-manager/concepts/resources-hierarchy.md#cloud).
   1. To the right of the cloud name, click ![image](../_assets/console-icons/ellipsis.svg).
   1. Select ![image](../_assets/console-icons/plus.svg) **Create folder**.
   
      ![create-folder1](../_assets/resource-manager/create-folder-1.png)
   
   1. Give your [folder](../resource-manager/concepts/resources-hierarchy.md#folder) a name. The naming requirements are as follows:
   
       * Length: between 3 and 63 characters.
       * It can only contain lowercase Latin letters, numbers, and hyphens.
       * It must start with a letter and cannot end with a hyphen.
   
   1. Optionally, specify the description for your folder.
   1. Select **Create a default network**. This will create a [network](../vpc/concepts/network.md#network) with subnets in each availability zone. Within this network, you will also have a [default security group](../vpc/concepts/security-groups.md#default-security-group), within which all network traffic will be allowed.
   1. Click **Create**.
   
      ![create-folder2](../_assets/resource-manager/create-folder-2.png)

1. [Assign](../iam/operations/roles/grant.md) the [vpc.user](../vpc/security/index.md#vpc-user) role and the [managed-redis.editor role (or higher)](security/index.md#roles-list) to your Yandex Cloud account. These roles allow you to create a cluster.

    {% note info %}
    
    If you cannot manage roles, contact your cloud or organization administrator.
    
    {% endnote %}

1. [Create a Linux VM](../compute/operations/vm-create/create-linux-vm.md#console_1).

    Specify the following settings:

    * **Boot disk image**: `Ubuntu 24.04` from Marketplace.
    * **Public IP address**: `Auto`.
    * **Security groups**: Leave this field empty.

        The VM will be assigned [the default security group](../vpc/concepts/security-groups.md#default-security-group) with the `default-sg` prefix. This security group enables SSH connections to the VM and allows any outgoing traffic.

    Configure the other settings as needed.

1. [Create a security group](../vpc/operations/security-group-create.md) in the same network as the VM. This security group will be assigned to the new Valkey™ cluster.

    In the security group, add a [rule](operations/connect/index.md#configuring-security-groups) to allow [non-sharded Valkey™ cluster](concepts/sharding.md) connections. Configure the rule to allow incoming traffic from the default security group assigned to the VM.


## Create a cluster {#cluster-create}


Create a non-sharded Valkey™ cluster [without public access](concepts/network.md#public-access-to-host). You can only [connect](#connect) to such a cluster from a VM in the cluster network.


To create a cluster:

1. In the management console, select the folder where you want to create your Valkey™ cluster.
1. Navigate to **Yandex Managed Service for&nbsp;Valkey™**.
1. Click **Create cluster**.
1. Specify the following cluster settings:

    * **Basic parameters**:

        * **Cluster name**: Cluster name. It must be unique within the folder.
        * **Cluster sharding**: Keep this option disabled.
        * Enable **TLS support**.
        * Enable **Use FQDN instead of IP addresses**.

    * **Network settings**:

        * **Network**: Specify the network with the [previously created](#before-you-begin) VM.
        * **Security groups**: Specify the [previously created](#before-you-begin) security group for the cluster.

    * **Hosts** → **Public access**: Make sure to disable this option, i.e., set its value to `No`, for all cluster hosts.

    * **DBMS settings** → **Password**: User password.

        The password must be from 8 to 128 characters long and match the `[a-zA-Z0-9@=+?*.,!&#$^<>_-]*` regular expression.

1. Click **Create cluster**.
1. Wait until the cluster is ready: its status on the Yandex Managed Service for Valkey™ dashboard will change to **Running** and its state, to **Alive**. This may take a while.

To learn more about creating a cluster, see [this guide](operations/cluster-create.md).


## Connect to the cluster {#connect}

1. [Connect](../compute/operations/vm-connect/ssh.md) over SSH to the [virtual machine you created earlier](#before-you-begin).

1. Install `redis-cli`:

    ```bash
    sudo apt update && sudo apt install --yes redis-tools
    ```

1. Connect directly to the master host:

    {% list tabs group=connection %}

    - Connecting without SSL {#without-ssl}

        ```bash
        redis-cli -h c-<cluster_ID>.rw.mdb.yandexcloud.net \
          -p 6379 \
          -a <Valkey™_password>
        ```

    - Connecting with SSL {#with-ssl}

        1. Get the SSL certificate:

            ```bash
            mkdir -p ~/.redis && \
            wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" \
                 --output-document ~/.redis/YandexInternalRootCA.crt && \
            chmod 0655 ~/.redis/YandexInternalRootCA.crt
            ```
            
            The certificate will be saved to the `~/.redis/YandexInternalRootCA.crt` file.

        1. Run this command:

            ```bash
            redis-cli -h c-<cluster_ID>.rw.mdb.yandexcloud.net \
              -p 6380 \
              -a <Valkey™_password> \
              --tls \
              --cacert ~/.redis/YandexInternalRootCA.crt
            ```

    {% endlist %}

    You can get the cluster ID with the [list of clusters in the folder](operations/cluster-list.md#list-clusters).

    To see code examples with the host FQDN filled in, open the cluster page in the [management console](https://console.yandex.cloud) and click **Connect**.

1. Once connected, send the `PING` command. Valkey™ should respond with `PONG`.


## What's next {#whats-next}

* Read about the [service concepts](concepts/index.md).
* Learn more about [creating a cluster](operations/cluster-create.md) and [connecting to a cluster](operations/connect/index.md).
* Check out the [questions and answers](qa/general.md).