Skip to main content

Connect with redis-cli

This example demonstrates how to connect to Dragonfly® using redis-cli, which supports nearly all the same commands as it does for Redis®. For more information, see Dragonfly CLI.


Replace the following placeholders in the code sample with the appropriate values:

DRAGONFLY_URIURL for the Dragonfly connection


Ensure the following before proceeding:

  1. The redis-cli client installed. This can be installed as part of the Redis®* server installation or as a standalone client. Refer to the Redis Installation Guide for more information.


To connect to Dragonfly, execute the following command in a terminal window:

redis-cli -u DRAGONFLY_URI

This command connects you to your Dragonfly instance.

To verify the connection is successful, use the INFO command:


This command should return various Dragonfly parameters similar to Redis:

# Server

To set a key, use the following command:

SET mykey mykeyvalue123

This should return a confirmation OK.

To retrieve the set key value, use:

GET mykey

The output will be the value of the key, in this case, "mykeyvalue123".