PQ
PQ.Hosting

Currency

Valkey: BSD Fork of Redis — Installation, Migration, and Usage

Author
PQ
April 06, 2026
7 min read
102 views

In March 2024, Redis changed its license from BSD to a dual model: SSPL + RSALv2. Both licenses are considered incompatible with the OSI open-source definition. For commercial use, this means restrictions, vendor lock-in, and potential licensing risks. In response, the Linux Foundation forked Redis 7.2.4 and released Valkey - a fully BSD-compatible fork with a transparent governance model. The project is backed by AWS, Google Cloud, Oracle, Ericsson and several other major players. If you are currently running Redis 7 and do not plan to pay for Redis Software or Redis Cloud, Valkey is the straightforward migration path.

What is Valkey

Valkey is a fork of Redis 7.2.4, created in March 2024 under the Linux Foundation. License: BSD 3-Clause, with no restrictions on commercial use.

Key characteristics:

  • Full API-level compatibility: all Redis commands work without changes
  • Data format compatibility: RDB and AOF files are read directly
  • RESP2/RESP3 protocol: existing client libraries (redis-py, Jedis, ioredis, go-redis) require no changes
  • Default port: 6379 - the same as Redis
  • Current version: Valkey 8.x (2025)

Valkey 8 introduces improvements to multithreaded I/O processing, increasing throughput on multi-core servers. Redis 7 is single-threaded for command execution logic in most operations - Valkey has started moving toward broader use of threads without breaking semantics.

Sentinel and Cluster are fully supported - configurations migrate without modifications.

Valkey vs Redis 7 vs Dragonfly vs KeyDB

  • Valkey 8 - BSD 3-Clause license, full Redis API compatibility (fork), higher performance than Redis 7 on I/O workloads, backed by Linux Foundation, AWS, Google Cloud
  • Redis 7.4+ - SSPL + RSALv2 license (not open-source), the compatibility reference, supported by Redis Ltd.
  • Dragonfly - BSL 1.1 license (also not open-source), high compatibility but not 100%, claims significantly higher performance, supported by Dragonfly Inc.
  • KeyDB - BSD license (Redis fork), high compatibility, multithreaded, supported by Snap Inc. (development has slowed)

Dragonfly and KeyDB are not drop-in replacements in the full sense: both have incompatibilities with specific commands or Cluster behavior. Valkey maintains binary compatibility because it is a fork, not a reimplementation.

Installing Valkey on Ubuntu/Debian

The official Valkey repository supports Ubuntu 20.04, 22.04, 24.04 and Debian 11/12.

Step 1 - Add the key and repository:

curl -fsSL https://packages.valkey.io/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://packages.valkey.io/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/valkey.list

Step 2 - Install the package:

sudo apt update
sudo apt install valkey -y

Step 3 - Enable and start the service:

sudo systemctl enable valkey
sudo systemctl start valkey

Step 4 - Verify the version:

valkey-server --version
# Output: Valkey server v=8.x.x ...

Configuration file: /etc/valkey/valkey.conf

Installing Valkey on CentOS/AlmaLinux

On CentOS Stream 9 and AlmaLinux 9 the official RPM repository is added in the same way.

Step 1 - Add the repository:

sudo tee /etc/yum.repos.d/valkey.repo << 'EOF'
[valkey]
name=Valkey
baseurl=https://packages.valkey.io/rhel/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://packages.valkey.io/valkey-archive-keyring.gpg
EOF

Step 2 - Install:

sudo dnf install valkey -y

Step 3 - Start:

sudo systemctl enable --now valkey

If the repository is not available for your distribution, Valkey can be built from source:

# Dependencies
sudo dnf install gcc make tcl -y

# Download and build
wget https://github.com/valkey-io/valkey/archive/refs/tags/8.0.0.tar.gz
tar xzf 8.0.0.tar.gz
cd valkey-8.0.0
make -j$(nproc)
sudo make install

# Config
sudo mkdir -p /etc/valkey
sudo cp valkey.conf /etc/valkey/valkey.conf

Migrating from Redis 7 to Valkey

Since Valkey is a fork of Redis 7.2.4, the RDB file format is identical. The simplest migration: stop Redis, replace the binary, start Valkey with the same RDB file.

Option 1 - In-place replacement on the same server (with brief downtime):

# 1. Take a data snapshot
redis-cli BGSAVE
# Wait for completion
redis-cli LASTSAVE

# 2. Stop Redis
sudo systemctl stop redis

# 3. Copy the RDB to the Valkey directory
redis-cli CONFIG GET dir
# Typically /var/lib/redis/dump.rdb

sudo cp /var/lib/redis/dump.rdb /var/lib/valkey/dump.rdb
sudo chown valkey:valkey /var/lib/valkey/dump.rdb

# 4. Start Valkey
sudo systemctl start valkey

# 5. Verify data
valkey-cli DBSIZE

Option 2 - Live replication (zero downtime):

# On the new server running Valkey - set up replication from Redis
valkey-cli REPLICAOF <redis-host> 6379

# Wait for full synchronization
valkey-cli INFO replication
# master_link_status:up - synchronization complete

# Switch the application to the new server
# Then disable replication
valkey-cli REPLICAOF NO ONE

This method works because Valkey understands the Redis 7 replication protocol without any changes.

Key configuration differences

Valkey configuration file: /etc/valkey/valkey.conf. Most directives are identical to redis.conf. Differences are minimal:

  • bind, port, daemonize, requirepass, maxmemory, maxmemory-policy - identical to Redis 7, migrate without changes
  • io-threads - new directive in Valkey 8, enables multithreaded I/O (not present in Redis 7)
  • io-threads-do-reads - enable alongside io-threads

Example of enabling multithreaded I/O in valkey.conf:

io-threads 4
io-threads-do-reads yes

It is recommended to set io-threads to the number of physical cores minus 1. On a VPS with 4 cores - io-threads 3.

If you are copying redis.conf to valkey.conf - the file transfers without edits for a basic configuration. Redis 7.4+ specific directives (introduced after the fork) may not be recognized - Valkey will log a warning but will not crash.

Verification and first commands

After starting Valkey, run a basic check:

# Connectivity check
valkey-cli ping
# PONG

# Server information
valkey-cli info server | grep -E "valkey_version|redis_version|os:|tcp_port"
# valkey_version:8.0.0
# redis_version:8.0.0
# tcp_port:6379

# Write and read a key
valkey-cli SET testkey "hello from valkey"
valkey-cli GET testkey
# "hello from valkey"

# Check the number of keys
valkey-cli DBSIZE

# Memory usage
valkey-cli info memory | grep used_memory_human

# Benchmark
valkey-benchmark -q -n 100000

In the INFO output, the redis_version field is present for backward compatibility - this is expected. Client libraries that check the version through this field will continue to work correctly.

Frequently asked questions

Is Valkey production-ready? Yes. Valkey 8.x is a stable release branch, used in production by major cloud providers. AWS ElastiCache and AWS MemoryDB migrated to Valkey as their primary engine in 2024. Google Cloud Memorystore has also added Valkey support.

Do I need to change client libraries? No. redis-py, Jedis, ioredis, go-redis, StackExchange.Redis and other popular clients work with Valkey without changes - the RESP2/RESP3 protocol is identical. There is no need to change the connection string, only the host/port if you are moving to a different server.

Do Redis Sentinel and Cluster work with Valkey? Yes, both modes are fully supported. The sentinel.conf configuration migrates without changes. For Cluster - valkey-cli --cluster works with the same parameters as redis-cli --cluster.

Does AWS ElastiCache support Valkey? Yes. Since October 2024, AWS ElastiCache offers Valkey as a separate engine alongside Redis OSS. When creating a new cluster in the console, you can choose Valkey 7.2 or Valkey 8.0.

What if I need Redis 7.4+ features (introduced after the fork)? Valkey is developed independently - version 8.0 already includes its own performance improvements. The roadmap can be followed at github.com/valkey-io/valkey. Features specific to commercial Redis (Redis Stack, Search/JSON in the paid version) are not included in Valkey - but open-source versions of these modules exist separately.

Share this article

Related Articles