Skip to content

Performance

Valkey vs Redis in 2026: Which to Use for Laravel and WordPress

Valkey vs Redis in 2026: licenses, versions, speed and compatibility, then install and secure Valkey on Ubuntu 24.04 for Laravel caches, queues and WordPress.

9 min read By the Hanoo team

For more than a decade, "add Redis" was the standard answer to a slow PHP app. Then in 2024 Redis changed its license, the Linux Foundation forked it as Valkey, and the default answer split in two. By 2026 Valkey ships in Ubuntu and in most cloud providers' managed caches, and Redis has gone back to an open-source license with Redis 8.

If you run Laravel or WordPress on your own server, you want to know which one to install and whether switching changes anything. This guide covers what changed, how the two compare today, and how to install and secure Valkey on Ubuntu 24.04 for Laravel and WordPress.

What happened between Redis and Valkey

  • Up to Redis 7.2 (2023): Redis was BSD-licensed open source.
  • March 2024: Redis Ltd. moved Redis 7.4 and later to dual source-available licenses (RSALv2 and SSPLv1). Neither is approved by the Open Source Initiative.
  • March 2024: Former Redis maintainers forked the last BSD release, 7.2.4, as Valkey under the Linux Foundation. AWS, Google Cloud, Oracle, Ericsson and others backed it.
  • May 2025: Redis 8 added the AGPLv3 as a third license option, so Redis is open source again, now with copyleft terms.
  • 2025–2026: Valkey 8 brought a new multi-threaded I/O model and 9.0 followed. Valkey 9.1 (May 2026) added database-level access control and further speed and memory gains. On the Redis side, Redis 8.6 (February 2026) is the current line, with large throughput and memory improvements over 7.2.

Valkey vs Redis at a glance

ValkeyRedis Open Source
LicenseBSD 3-ClauseAGPLv3, RSALv2 or SSPLv1 (your choice)
GovernanceLinux Foundation, many vendorsRedis Ltd.
Current line (Nov 2026)9.18.6
Ubuntu 24.04 archivevalkey-server 7.2 (universe)redis-server 7.0 (universe)
Ubuntu 26.04 archivevalkey 9.0 (main)redis 8.0 (universe)
Protocol and commandsRESP2/RESP3, Redis 7.2 compatibleRESP2/RESP3
JSON, search, time seriesSeparate modules (valkey-json, valkey-search, valkey-bloom)Built into Redis 8
Laravel, WordPress, phpredis, PredisWork unchangedWork unchanged
Managed offeringsAWS ElastiCache and MemoryDB, Google Memorystore, DigitalOcean and othersRedis Cloud, and others

Licensing in practice

For a cache behind your own Laravel or WordPress app, neither license gets in your way. The AGPL's copyleft applies to Redis itself: if you modify Redis and offer it to others as a network service, you must publish your changes. Using an unmodified Redis as your app's cache doesn't trigger that. Valkey's BSD license has no such conditions at all, which is why cloud providers and Linux distributions prefer it. If your company has a blanket "no AGPL" policy, choose Valkey.

Performance

Both are fast enough that, for a typical PHP app, the cache is never the bottleneck. A cache lookup over localhost takes well under a millisecond, while your PHP code and SQL queries take tens of milliseconds. The headline benchmarks, such as Valkey 9.1's 2.1 million requests per second on one server (9 I/O threads, 512-byte values, pipelining) or Redis 8.6's gains over 7.2, matter at very high traffic. For a single VPS, choose on licensing, packaging and support instead.

Compatibility

Valkey still reports redis_version:7.2.4 in INFO, so clients that check versions keep working. Everything a PHP app uses (strings, hashes, lists, sorted sets, expiries, Lua scripts, pub/sub) behaves the same way. The real differences are newer additions such as Redis 8's built-in JSON and query engine, or Valkey 9's newer commands. Laravel's cache, session, queue and lock drivers, and WordPress object-cache plugins, use neither.

Install Valkey on Ubuntu 24.04

Valkey is in Ubuntu's universe repository:

Terminal
sudo apt update
sudo apt install valkey-server
systemctl status valkey-server --no-pager
valkey-cli ping          # PONG

That gives you Valkey 7.2, which Canonical updates with point releases. It is a mature, Redis 7.2-compatible version and enough for Laravel and WordPress. If you need Valkey 9 features on 24.04, use the official valkey/valkey Docker image (published on 127.0.0.1 only), or move to Ubuntu 26.04, which ships Valkey 9.0.

If old scripts call redis-cli and redis-server, the valkey-redis-compat package adds the familiar names.

Configure it safely

The main file is /etc/valkey/valkey.conf. Set these for a cache on a web server:

Valkey
bind 127.0.0.1 -::1
protected-mode yes
port 6379

maxmemory 256mb
maxmemory-policy allkeys-lru

# A pure cache can skip writing to disk:
save ""
appendonly no

Then sudo systemctl restart valkey-server.

  • bind 127.0.0.1: never expose port 6379 to the internet. Exposed Redis and Valkey servers are scanned for constantly and abused within hours. If another server needs access, allow that one IP address in the firewall and require a password or a TLS client certificate.
  • maxmemory: without it, the cache grows until the kernel kills a process, and that may be your database.
  • allkeys-lru: when full, drop the least recently used keys. That is right for a cache and wrong for queues. See below.

Use access control instead of one shared password

Valkey 7.2 has ACL users, so each app gets its own login and key prefix:

Terminal
valkey-cli
Valkey
ACL SETUSER shop on >a-long-random-password ~shop:* &* +@all -@admin
ACL SETUSER default on nopass -@all +ping
ACL SAVE

The shop user can only touch keys starting with shop: and can't run admin commands such as CONFIG or SHUTDOWN. The default user can only PING. One limit remains: FLUSHDB, which Laravel's cache:clear uses, empties the whole database, including other apps' keys. If several apps share a server and that matters, give each app its own Valkey instance. ACL SAVE needs an aclfile line in valkey.conf, for example aclfile /etc/valkey/users.acl (create the file first, owned by valkey). Or put the user lines directly in valkey.conf.

Separate cache from queues

A cache may lose data. A queue must not. Running both in one instance with allkeys-lru means that under memory pressure, Valkey can evict queued jobs. Use two instances:

InstanceUsemaxmemory-policyPersistence
cacheCache, and sessions if losing them is acceptableallkeys-lruOff
queueQueues, locks, Horizonnoevictionappendonly yes, appendfsync everysec

With one instance, use noeviction and size maxmemory generously. Our guide to Laravel queue workers in production covers the worker side. Then a full cache returns errors instead of silently dropping jobs.

Use Valkey with Laravel

Laravel needs no Valkey driver. Its redis driver works unchanged. Install the phpredis extension for your PHP version:

Terminal
sudo apt install php8.4-redis

Then set it up in .env:

.env
REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_USERNAME=shop
REDIS_PASSWORD=a-long-random-password
REDIS_PREFIX=shop:

CACHE_STORE=redis
SESSION_DRIVER=redis
QUEUE_CONNECTION=redis

REDIS_PREFIX=shop: keeps every key inside the ACL pattern above. If you use Horizon, it uses its own prefix. Set HORIZON_PREFIX=shop:horizon: too, or the ACL will block it. Check the whole setup with:

Terminal
php artisan tinker --execute="Cache::put('ping', 'pong', 10); echo Cache::get('ping');"

To use separate instances for cache and queues, define two connections in config/database.php under redis (for example cache on port 6379 and queue on 6380). Then point config/cache.php's redis store and config/queue.php's redis connection at them.

Use Valkey with WordPress

If you're setting up a new site, start with installing WordPress on Ubuntu 24.04. WordPress uses Valkey as a persistent object cache: the results of repeated database queries are kept in memory between requests. This helps most on WooCommerce, logged-in users and wp-admin, which page caches can't serve.

  1. Install php8.4-redis and restart PHP-FPM.
  2. Install the Redis Object Cache plugin by Till Krüss. Its author confirms it is fully compatible with Valkey.
  3. Add the connection to wp-config.php, above "That's all, stop editing!":
PHP
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_PASSWORD', ['blog', 'a-long-random-password']); // ACL user and password
define('WP_REDIS_PREFIX', 'blog:');
define('WP_REDIS_MAXTTL', 86400);
  1. Go to Settings → Redis and click Enable Object Cache. Check that the status reads Connected.

On a server with several WordPress sites, a unique prefix per site is the minimum, so sites never read each other's cache. A separate Valkey process per site, running as the site's own user on a Unix socket, is stronger isolation.

Should you switch from Redis to Valkey?

  • New server: install Valkey. It's in Ubuntu's archive, permissively licensed, and every PHP client works with it.
  • Running Ubuntu's own Redis 7.0 package: switching is low risk. Valkey 7.2 can load Redis 7.0 and 7.2 data files, and for a pure cache you can simply start empty.
  • Running Redis 7.4 or 8 from Redis's own repository: those versions write a newer data file format, so copying dump.rdb across may not work. Cache data can simply be rebuilt. For queues, let workers drain the queue before switching.
  • Using Redis 8's JSON or search features: stay on Redis, or check that Valkey's modules cover what you use.
  • Using a managed cache: many providers now offer Valkey at a lower price. AWS, for example, prices ElastiCache Serverless for Valkey 33% below its other engines.

How Hanoo handles Valkey

Hanoo manages Ubuntu servers you own and uses Valkey, not Redis, for caching.

  • Install from Manage Services. Hanoo installs Ubuntu's valkey-server already hardened. It listens on localhost only, with protected mode on, and the default user can only answer PING. Another Linux user on the same server can't quietly use an installed but unused cache as shared storage.
  • One-click WordPress object cache. On a WordPress application's Optimize WordPress tab, turn on the object cache. Hanoo starts a separate Valkey process for that site, running as the site's own Linux user on a private Unix socket, with no TCP port at all. It has a memory cap, LRU eviction and nothing written to disk, and runs in a sandboxed systemd unit. Hanoo installs the pinned Redis Object Cache drop-in, checks that it works, and can undo the whole change from the same tab.
  • Isolated per site. One site's cache can't be read or flushed by another site, even on the same server.

Everything stays standard Ubuntu packages and systemd units on your own server, so you can inspect or change it over SSH.

Frequently asked questions

Is Valkey a drop-in replacement for Redis?

For Redis 7.2 and earlier features, yes. Valkey speaks the same protocol and commands, so phpredis, Predis, Laravel's redis driver and WordPress object-cache plugins work without code changes. Only features Redis added later, such as Redis 8's built-in JSON and search, differ.

Is Redis open source again?

Yes, since Redis 8 (2025), which can be used under the AGPLv3, an OSI-approved open-source license. You can also choose RSALv2 or SSPLv1 instead. Valkey stays under the permissive BSD 3-Clause license.

Is Valkey faster than Redis?

It depends on the version and workload. Both projects have made big multi-threading and memory gains since the fork. For caching in a PHP app on one server, the difference won't be measurable, because PHP and SQL take far longer than a cache lookup.

Which version of Valkey does Ubuntu 24.04 have?

Ubuntu 24.04 ships Valkey 7.2 in its universe repository (sudo apt install valkey-server), updated with point releases. Ubuntu 26.04 LTS ships Valkey 9.0. For newer versions on 24.04, use the official Docker image.

Does Laravel support Valkey?

Yes, through its existing redis driver. Set REDIS_HOST to your Valkey server and keep REDIS_CLIENT=phpredis. Cache, sessions, queues, locks and Horizon all work unchanged.

Should cache and queues share one Valkey instance?

Better not. A cache should evict old keys when memory is full, but a queue must never lose jobs. Use one instance with allkeys-lru for cache and another with noeviction and persistence for queues. If you must share one, use noeviction.