Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Managed Service for Valkey™
  • Getting started
    • All guides
      • Pre-configuration
      • FQDNs of hosts
      • Connecting from applications
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Command line tools
  • redis-cli
  • Valkey™ Sentinel
  • Connecting from graphical IDEs
  • Before you connect from a Docker container
  1. Step-by-step guides
  2. Connection
  3. Connecting from applications

Connecting to an Valkey™ cluster from applications

Written by
Yandex Cloud
Updated at February 13, 2026
  • Command line tools
    • redis-cli
    • Valkey™ Sentinel
  • Connecting from graphical IDEs
  • Before you connect from a Docker container

You can connect to a Valkey™ cluster using command line tools, graphical IDEs, or Docker containers. To learn how to connect from your application code, see Code examples.

Command line toolsCommand line tools

To see code examples with the host FQDN filled in, open the cluster page in the management console and click Connect.

The setup method depends on whether sharding is enabled in the cluster.

redis-cliredis-cli

For Valkey™ clusters, there is support for encrypted connections on port 6380 and unencrypted connections on port 6379.

Warning

When using SSL, you can only connect to clusters with TLS support enabled.

To always connect to the master in a non-sharded cluster, use a special FQDN that always points to the master, or track the roles of all cluster hosts yourself.

Connecting without SSL
Connecting with SSL
  1. Before connecting, install the required dependencies:

    sudo apt update && sudo apt install -y redis-tools
    
  2. Connect directly to the master host:

    • In a sharded cluster:

      redis-cli \
          -h c-<cluster_ID>.rw.mdb.yandexcloud.net \
          -a <password>
      
    • In a non-sharded cluster:

       redis-cli \
           -c \
           -h <FQDN_of_master_host_in_target_shard> \
           -a <password>
      
  1. Before connecting, install the dependencies:

    Build redis-tools with TLS support using one of the two methods:

    • From a repository

      1. Add a repository:

        sudo apt-add-repository ppa:redislabs/redis
        

        The repository’s packages come pre-built with BUILD_TLS=yes.

      2. Install the tool:

        sudo apt update && sudo apt install -y redis-tools
        
    • Manually

      Go to the directory you want to download the distribution to. Download the stable tool version, then build and install it:

      wget https://download.redis.io/redis-stable.tar.gz && \
      tar -xzvf redis-stable.tar.gz && \
      cd redis-stable && \
      make BUILD_TLS=yes && \
      sudo make install && \
      sudo cp ./src/redis-cli /usr/bin/
      
  2. Connect directly to the master host:

    • In a sharded cluster:

      redis-cli \
          -h c-<cluster_ID>.rw.mdb.yandexcloud.net \
          -a <password> \
          -p 6380 \
          --tls \
          --cacert ~/.redis/YandexInternalRootCA.crt
      
    • In a non-sharded cluster:

      redis-cli \
          -c \
          -h <FQDN_of_master_host_in_target_shard> \
          -a <password> \
          -p 6380 \
          --tls \
          --cacert ~/.redis/YandexInternalRootCA.crt \
      

To learn how to get a host FQDN, see this guide.

Once connected to the cluster, run these commands:

SET foo bar
GET foo

If your cluster connection and test command are successful, you will see the bar string in the output.

Valkey™ SentinelValkey™ Sentinel

Valkey™ Sentinel is a Valkey™ host management system that enables monitoring, notification, automatic failover, and providing clients with the current host addresses.

For non-sharded clusters, there is support for unencrypted connections on port 26379 with any Valkey™ version.

If your client application does not support connecting via Sentinel, connect directly to the master. Otherwise, use Sentinel for more reliable cluster host management:

Connecting without SSL
  1. Before connecting, install the required dependencies:

    sudo apt update && sudo apt install -y redis-tools
    
  2. Get the master host address by using Sentinel and any Valkey™ host:

    redis-cli \
        -h <FQDN_of_any_Valkey™_host> \
        -p 26379 \
        sentinel \
        get-master-addr-by-name <Valkey™_cluster_name> | head -n 1
    
  3. Connect to the host with this address:

    redis-cli \
        -h <Valkey™_master_host_address> \
        -a <Valkey™_password>
    

To learn how to get a host FQDN, see this guide.

Once connected to the cluster, run these commands:

SET foo bar
GET foo

If your cluster connection and test command are successful, you will see the bar string in the output.

For more information about Sentinel, see Replication and fault tolerance and this Valkey™ guide.

Connecting from graphical IDEsConnecting from graphical IDEs

The connection was tested in the following environment:

  • MacOS Big Sur 11.3.
  • DBeaver Enterprise: 21.0.

You can only use graphical IDEs to connect to cluster hosts through an SSL tunnel using the VM you created. Before connecting, prepare a certificate.

To avoid connection errors, save the certificate to a local folder that does not require administrator rights to access.

DBeaver

Connections to Valkey™ clusters are only available in DBeaver commercial editions.

To connect to your cluster:

  1. Create a new database connection:
    1. In the Database menu, select New connection.
    2. Select Valkey™ from the DB list.
    3. Click Next.
    4. Specify the connection settings on the Main tab:
      • Host: FQDN of the master host or a special FQDN always pointing to the current master host.
        When connecting to a sharded cluster, specify comma-separated FQDNs of master hosts in each shard.
      • Port: 6379 for a regular cluster, or 6380 for a cluster with SSL encryption enabled.
      • Under Authentication, enter the cluster password.
    5. On the SSH tab:
      1. Enable Use SSL tunnel.
      2. Configure the SSH tunnel:
        • Host/IP: Public IP address of the VM to connect to.
        • Username: Username for connecting to the VM.
        • Authentication method: Public key.
        • Secret key: Path to the private key file for the VM connection.
        • Passphrase: Private key password.
    6. On the SSL tab:
      1. Enable Use SSL and Skip hostname validation settings.
      2. Under Parameters:
        1. Select Method: Set of certificates.
        2. In the Root certificate field, specify the path to the saved SSL certificate file.
  2. Click Test Connection .... If the connection is successful, you will see the connection status, DBMS information, and driver details.
  3. Click Done to save the database connection settings.

Before you connect from a Docker containerBefore you connect from a Docker container

To connect to a Yandex Managed Service for Valkey™ cluster from a Docker container, add the following lines to the Dockerfile:

Connecting without SSL
Connecting with SSL
# Build redis-tools with TLS support manually.
RUN apt-get update && \
    apt-get install make gcc libssl-dev --yes && \
    wget https://download.redis.io/redis-stable.tar.gz && \
    tar -xzvf redis-stable.tar.gz && \
    cd redis-stable && \
    make BUILD_TLS=yes MALLOC=libc && \
    make install && \
    cp ./src/redis-cli /usr/bin/
# Build redis-tools with TLS support manually.
RUN apt-get update && \
    apt-get install wget make gcc libssl-dev --yes && \
    wget https://download.redis.io/redis-stable.tar.gz && \
    tar -xzvf redis-stable.tar.gz && \
    cd redis-stable && \
    make BUILD_TLS=yes MALLOC=libc && \
    make install && \
    cp ./src/redis-cli /usr/bin/ && \
    # Get an SSL certificate.
    mkdir --parents ~/.redis && \
    wget "https://storage.yandexcloud.net/cloud-certs/CA.pem" \
         --output-document ~/.redis/YandexInternalRootCA.crt && \
    chmod 0655 ~/.redis/YandexInternalRootCA.crt

Was the article helpful?

Previous
FQDNs of hosts
Next
Overview
© 2026 Direct Cursus Technology L.L.C.