---
title: "Valkey - Connect with CLI"
description: "Learn how to connect to a Valkey service with a Command Line Interface (CLI)."
url: https://docs.us.ovhcloud.com/en/public-cloud/databases/valkey-connect-cli
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# Valkey - Connect with CLI

**Learn how to connect to a Valkey service with a Command Line Interface (CLI).**

Cloud Databases allow you to focus on building and deploying cloud applications while OVHcloud takes care of the database infrastructure and maintenance in operational conditions.

 

## Requirements

- Access to the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/)
- A [Public Cloud project](https://us.ovhcloud.com/public-cloud/) in your OVHcloud account
- A Valkey service running on your OVHcloud Cloud Databases ([this guide](https://docs.us.ovhcloud.com/en/public-cloud/databases/getting-started.md) can help you to meet this requirement)
- [Configure your Valkey service](https://docs.us.ovhcloud.com/en/public-cloud/databases/valkey-configure-instance-accept-incoming-connections.md) to accept incoming connections

 

## Concept

A Valkey service can be managed in multiple ways.

One of the easiest, yet powerful, is to use a Command Line Interface (CLI), also known as a Console or Terminal. To interact correctly with the instance, we need to first install something called a client to connect and control the Valkey service remotely.

It's a Client-Server interaction.

 

## Instructions

### Installing redis-cli on your client

**Note:**

Please note that redis-cli is natively integrated into the redis package.

You first need to install software to interact with your instance remotely. This official software can be installed on various systems like your own computer, a VPS, or a virtual machine. The only requirements are that the system can reach public networks (Internet) and that the user has sufficient privileges to install the software.

To do so, and depending on your configuration, you may need to follow the official Redis® documentation to install redis-cli, part of the [Redis server package](https://redis.io/download).

We are now ready to learn how to connect to our instance.

 

### Connection

We will now follow the official Redis® documentation to perform our first connection.

In your terminal, type `redis-cli -u rediss://<username>:<password>@<hostname>:<port> ping`.

The result should look like this:

```bash
$ redis-cli -u rediss://redisUser:3FAKExSW6Rez9Xw0admB@redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185 ping
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
PONG
```

It means that the instance is running and responding to your command.

To be in interactive mode, do not use any particular command:`redis-cli -u rediss://<username>:<password>@<hostname>:<port>`.

If you want to log in without authentication, you can try connecting without a user and then use the AUTH command, i.e., `redis-cli -u rediss://<hostname>:<port>`.

Don't forget you need to modify the username, password, hostname, and port.

In our example, it will look like this:

```bash
$ redis-cli -u rediss://redisUser:3FAKExSW6Rez9Xw0admB@redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185    
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185> PING
PONG
redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185> HELLO
 1) "server"
 2) "redis"
 3) "version"
 4) "6.2.3"
 5) "proto"
 6) (integer) 2
 7) "id"
 8) (integer) 20652
 9) "mode"
10) "standalone"
11) "role"
12) "master"
13) "modules"
14) (empty array)
redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185>
```

**Tip:**

**Congratulations!** You are now fully able to interact with your instance!

 

### redis-cli usage

You can manage your instance using the command line interface in an interactive mode or by setting parameters as redis-cli arguments.

Please follow the official Redis® [redis-cli documentation](https://redis.io/topics/rediscli/).

 

### In the event of connection or command execution issues

In case you don't use a defined user in your command line or do not have enough privileges, etc., you will get a _NOAUTH_ or _AUTH failed_ response like below.

```bash
redis-cli -u rediss://redis-9f6095f3-9f6095f3.database.cloud.ovh.us:20185 ping
(error) NOAUTH Authentication required.
```

In case the user doesn't have the right privilege, you will get a _NOPERM_ response. In this case, please review your user's roles and attached ACL. For further reading, please refer to the [Official Redis® ACL documentation](https://redis.io/topics/acl/).

 

## Go further

Visit the [GitHub examples repository](https://github.com/ovh/public-cloud-databases-examples/tree/main/databases/redis) to find out how to connect to your database with several languages.

Browse all the [Databases guides](https://docs.us.ovhcloud.com/en/public-cloud/databases/landing-page-databases.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [Managed Databases](https://us.ovhcloud.com/public-cloud/databases/) on the OVHcloud US website.
