Skip to content

Quick start

Valkey GLIDE is the open-source client library for Valkey. Designed for performance and consistency between supported languages. This guide will show how to quickly install and set up a simple development environment for Valkey GLIDE.

GLIDE provides two main client types:

  • GlideClient: For standalone Valkey instances.
  • GlideClusterClient: For cluster deployments.

For this guide, we will use a standalone client to connect to a Valkey Docker instance.

  1. Follow the instructions on the Docker website to install Docker for your operating system.

  2. Start a local Valkey server:

    Terminal window
    # Pull and run Valkey server
    docker run -d --name valkey-server -p 6379:6379 valkey/valkey:latest
    # Verify it's running
    docker ps
  3. Verify connection with Valkey server:

    Terminal window
    docker exec valkey-server valkey-cli ping
    # Expected output: PONG
  • Ubuntu 20 (x86_64/amd64 and arm64/aarch64)
  • Amazon Linux 2 (AL2) and 2023 (AL2023) (x86_64). The Node.js client does not support AL2; see Known Issues.
  • Alpine Linux are not supported for Python and C# clients. See Installation Guide for more details.
  • macOS 14.7 (Apple silicon/aarch_64)
  • macOS 13.7 (x86_64/amd64)

Windows support is currently available for Valkey GLIDE Java and C#.

  • Windows (x86_64)
  • Windows (arm64) — C# only

Requirements: JDK 8+ (JDK 11+ recommended)

Add the following to your build tool. Make sure to specify your classifier for your OS.

dependencies {
implementation group: 'io.valkey', name: 'valkey-glide', version: '2.+'
}

The following code snippet performs a simple “ping” command to our docker Valkey instance. This will tell us that GLIDE was able to send and receive commands from Valkey. For testing against a live instance, update the GlideClient configurations.

import glide.api.GlideClient;
import glide.api.models.configuration.GlideClientConfiguration;
import glide.api.models.configuration.NodeAddress;
public class ConnectionTest {
public static void main(String[] args) {
// Create client configuration
GlideClientConfiguration config = GlideClientConfiguration.builder()
.address(NodeAddress.builder()
.host("localhost")
.port(6379)
.build())
.build();
try (GlideClient client = GlideClient.createClient(config).get()) {
// Test the connection
String response = client.ping().get();
// Valkey responds with PONG
System.out.println("Connected! Server responded: " + response);
} catch (Exception e) {
System.err.println("Connection failed: " + e.getMessage());
}
}
}

Running the above snippet should give you this response.

Terminal window
Connected! Server responded: PONG

GLIDE offers many configuration options to connect to Valkey through its configuration objects. These options, and other interfaces, stay consistent between languages.

// Setting up connection configuration
GlideClientConfiguration config = GlideClientConfiguration.builder()
.address(NodeAddress.builder()
.host("localhost")
.port(6379)
.build())
// Request timeout (milliseconds)
.requestTimeout(5000)
// TLS configuration (if needed)
.useTLS(false)
// Database selection
.databaseId(0)
.build();

Congratulations, you are now connected to Valkey using GLIDE! To see how to make basic operations take a look at the our guide.