Valkey Installation Guide: The Perfect Open Source Redis Alternative

Database tutorial - IT technology blog
Database tutorial - IT technology blog

The End of the “Free Ride” for Redis: What’s Happening?

If you’re in the industry, you’ve likely heard about Redis’s sudden license shift from BSD to BSL (Business Source License). Put simply, tech giants like AWS and Google are no longer allowed to use Redis for Managed Services without sharing profits or contributing back.

This event sent shockwaves through the Open Source community. Seeing a “go-to” tool suddenly restricted left many worried. That’s why Valkey was born. It’s not a brand-new project but a fork of Redis 7.2.4, backed by the Linux Foundation and supported by “Big Tech” players like AWS, Google, Oracle, and Ericsson.

Valkey commits to upholding core values: a powerful, high-performance in-memory data store that remains free forever.

How Does Valkey Differ from Other Forks?

There are several names vying to replace Redis. I’ve tried them out and have some practical insights:

  • KeyDB: Once famous for its multi-threading capabilities. However, this project seems to be slowing down compared to the momentum behind Valkey.
  • Redict: A fork that emphasizes minimalism. It maintains the original philosophy, but its supporting community is still quite modest.
  • Valkey: Considered the “official spiritual successor.” With over 1,000 new commits just months after launch, Valkey is well-optimized for modern CPUs and 100% compatible with existing Redis clients.

An Honest Review: Pros and Cons

Pros

  • Drop-in Replacement: You just need to swap redis-server for valkey-server. Your Node.js, Python, or PHP code will still run smoothly without changing a single line.
  • Impressive Performance: Real-world tests show Valkey can achieve 10-20% higher throughput than Redis in certain tasks, thanks to improvements in I/O handling.
  • BSD-3-Clause License: Complete freedom. Whether you’re using it for personal projects or a multi-million dollar startup, you don’t have to worry about legal issues.

Cons

  • New Name: When proposing it to clients, you might spend a little time explaining what Valkey is.
  • Ecosystem Transition: Some older GUI tools might not have updated their interface names to Valkey yet, even though the connection works fine.

Why I Chose Valkey for My New Project

Previously, Redis was my default choice for the caching layer. However, after the licensing shift, I’ve gradually moved to Valkey for microservices systems. The reason is practical: I want to avoid vendor lock-in and ensure the system always uses true open-source software.

Quick Valkey Installation Guide

Below are the two most common installation methods for Juniors.

Method 1: Using Docker (Fast and Clean)

This method keeps your environment clean. Just one command:

# Run Valkey container on port 6379
docker run --name my-valkey -p 6379:6379 -d valkey/valkey:latest

Once running, Valkey will listen on port 6379. You can use Redis Insight or any Redis management tool to connect immediately.

Method 2: Installing on Ubuntu (VPS)

If you want to install directly on an Ubuntu server, follow these steps:

# Add the official Valkey key and repository
sudo apt install -y curl gnupg
curl -fsSL https://pkg.valkey.io/debian/valkey-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/valkey-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/valkey-archive-keyring.gpg] https://pkg.valkey.io/debian $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/valkey.list

# Install
sudo apt update && sudo apt install valkey -y

To check if Valkey is running, use the command: sudo systemctl status valkey-server.

Testing with valkey-cli

All the commands you already know remain the same. Open your terminal and try:

valkey-cli

# Basic operations
127.0.0.1:6379> set project "Valkey Tutorial"
OK
127.0.0.1:6379> get project
"Valkey Tutorial"

Clearly, nothing has changed in terms of user experience compared to traditional Redis.

Notes on Migrating from Redis to Valkey

If you plan to migrate a running project from Redis to Valkey, keep these three points in mind:

  1. Configuration: Valkey uses the valkey.conf file. You can copy the contents of redis.conf directly without errors.
  2. Data: It reads old .rdb and .aof files perfectly. Just copy the dump file into Valkey’s data directory.
  3. Libraries: Packages like redis-py or ioredis still recognize Valkey as a standard Redis server.

Valkey is gradually becoming the new standard as operating systems like Fedora and Alpine Linux begin to replace Redis entirely. Getting familiar with it now is a smart career move. Good luck with your deployment!

Share: