selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Valkey logo

Self-host Valkey

9.0.7

Open-source in-memory key-value store and cache server

ReleaseOpen SourceBSD-3-Clause
sudo apt install valkey
Updated2 weeks ago
LanguageC
Setup difficultyEasy
Stars
27 715
Ports
6379 (default TCP client port), 16379 (cluster bus port used when running in cluster mode)
Docker
valkey/valkey

What is Valkey?

Should you self-host Valkey?

Valkey scores 81/100 on selfhost.directory (how scoring works) and ranks #3 of 38 in Databases. It has 27 715 GitHub stars, +324 in the last 30 days.

It shipped 22 stable releases in the past year. The latest, 9.0.7, came out on 27 October 2026.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is BSD-3-Clause-licensed and written mostly in C.

Its closest alternative on selfhost.directory is Redis (86/100, 77 489 stars). It scores higher overall, so compare the two before you pick. See Valkey vs Redis side by side.

Features

  • Access control lists (ACL)
  • Append-only file persistence
  • Asynchronous replication
  • High availability with Sentinel
  • I/O threading
  • Key expiration (TTL)
  • Key/value data structures
  • Lua ScriptingCan be compiled out with `make BUILD_LUA=no`.
  • Memory limit and eviction policies
  • Module plugins
  • Pub/Sub messaging
  • RDB snapshot persistence
  • TLS EncryptionSentinel mode does not support the TLS module.
  • Transactions

Valkey README

codecov OpenSSF Scorecard

This project was forked from the open source Redis project right before the transition to their new source available licenses.

This README is just a fast quick start document. More details can be found under valkey.io

What is Valkey?

How to install Valkey

Install Valkey with Docker

Example: docker run --rm valkey/valkey:9.1.2

Published on Docker Hub as valkey/valkey, with -trixie and -alpine tag variants; see https://valkey.io/topics/installation for more setup tips.

How to configure Valkey

  • bind127.0.0.1 -::1One or more IP addresses/interfaces to listen on; with no directive set the server listens on all interfaces.
  • port6379TCP port the server listens on for client connections; setting 0 disables the TCP socket.
  • protected-modeyesKeeps remote clients out when no authentication is configured; disable only when you really want external access.

    values: yes, no

  • tls-portTLS listen port, typically used together with port 0.
  • tls-cert-filePEM certificate used to authenticate the server to clients, primaries and cluster peers.

Valkey releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

Why did Linux Foundation start the Valkey project?

The FAQ points to the project history topic page for the background behind the Linux Foundation launching Valkey.

Why does my replica have a different number of keys than its primary instance?

With expiring keys this is expected: the RDB used for the first sync omits keys logically expired on the primary but still resident, so the replica loads fewer entries while both are logically identical.

What is the maximum number of keys a single Valkey instance can hold? What is the maximum number of elements in a Hash, List, Set, and Sorted Set?

Up to 2^32 keys per instance, with at least 250 million keys proven in practice, and each collection type can hold 2^32 elements. Realistically available memory is the limit.

How can Valkey use multiple CPUs or cores?

Turn on I/O threading, rewritten and much improved in version 8, to move client reading and writing off the main thread. Alternatively run several instances on the machine and group them into a cluster.

Are Valkey on-disk snapshots atomic?

Yes. The background save process is forked between command executions, so anything atomic in RAM is also atomic in the snapshot on disk.

Background saving fails with a fork() error on Linux?

Background saves rely on copy-on-write fork, and with overcommit_memory set to 0 Linux refuses the fork unless enough free RAM exists to duplicate everything. Setting overcommit_memory to 1 lets the fork proceed optimistically.

What happens if Valkey runs out of memory?

The maxmemory setting caps usage; once it is hit the server rejects write commands but still answers read-only ones. You can instead have it evict keys under an eviction policy.

How can I reduce Valkey' overall memory usage?

Plan the physical data model deliberately by picking suitable types and key patterns, and normalizing data. The Memory Optimization topic page covers further techniques.

Why does Valkey keep its entire dataset in memory?

The project tried virtual memory and similar approaches but decided to do one thing well: serve data from memory and use disk only for storage, so there are no plans for an on-disk backend.

What's the Valkey memory footprint?

An idle instance takes roughly 3 MB, one million small key/string pairs about 85 MB, and one million hashes with five fields about 160 MB. You can measure your own workload with valkey-benchmark plus the INFO memory command.

How is Valkey different from other key-value stores?

Its values can hold richer data types with atomic operations defined directly on them, without an extra abstraction layer. It is in-memory yet persisted to disk, so reads and writes are very fast while the dataset must fit in memory, and its two on-disk formats stay compact and append-only.

More in Databases

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…