Databases

Install Valkey on Debian 13 / 12

A working Valkey on Debian 13 takes about two minutes. Valkey is the community fork of Redis and a drop-in replacement for it, so the commands, the wire protocol, and the data files are the same. There are three ways to install it on Debian, and which one you pick comes down to the version you want. Here is each, straight to it.

Original content from computingforgeeks.com - post 168397

Built and run on Debian 13 (trixie) in June 2026.

Install from apt

Debian ships Valkey in its own repositories. Install the server and the valkey-cli client:

sudo apt update
sudo apt install -y valkey-server valkey-tools

The service starts and enables itself. Check the version and that it answers:

valkey-server --version
systemctl is-active valkey-server
valkey-cli ping

That returns a PONG. On Debian 13 the package comes from the main repository (the 8.1 line); the service is valkey-server and the config file is /etc/valkey/valkey.conf. On Debian 12, Valkey is only in bookworm-backports, so enable backports there or use the Docker or source method below, both of which work on any Debian release. A quick write confirms it is live:

Valkey service active and serving keys on Debian 13 trixie

That is the whole install if the apt version is current enough for you. If you need the newest release, use one of the next two.

Run the latest with Docker

The official image gives you the newest release in one command. Install Docker and run it:

sudo apt install -y docker.io
sudo docker run -d --name valkey -p 6379:6379 valkey/valkey:9.1

Check the version inside the container:

sudo docker exec valkey valkey-server --version

That reports the current 9.x release. The screenshot shows the version from each method side by side, so the gap between the apt package and the container is clear:

apt, Docker and source-built Valkey versions on Debian 13 trixie

Build from source

For the newest release as a native service with TLS, build it. Install the toolchain:

sudo apt install -y build-essential pkg-config libssl-dev libsystemd-dev curl

Detect the latest release, download, and compile with TLS and systemd support:

VER=$(curl -fsSL https://api.github.com/repos/valkey-io/valkey/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+')
cd /usr/local/src
sudo curl -fsSL "https://github.com/valkey-io/valkey/archive/refs/tags/${VER}.tar.gz" -o "valkey-${VER}.tar.gz"
sudo tar xzf "valkey-${VER}.tar.gz"
cd "valkey-${VER}"
sudo make BUILD_TLS=yes USE_SYSTEMD=yes -j"$(nproc)"
sudo make install

Keep libsystemd-dev in that list. Without it a Type=notify service starts the server but times out waiting for a ready signal it never sends. The systemd unit, user, and config are the same as in the Valkey on Ubuntu guide, which uses the identical build on the Debian-family base.

Use it

You are live. Before you put traffic on it, set bind 127.0.0.1, keep protected-mode yes, and add a password if anything off the box will connect. From there, the Valkey integration guide shows it working as a real cache with measured latency, a rate limiter, database-level ACLs, and a live Redis migration. On Rocky or AlmaLinux instead, the RHEL-family install covers the dnf and SELinux specifics.

valkey-cli quick reference

The commands you will reach for most, all against the running server:

CommandWhat it does
valkey-cli pingCheck the server answers
valkey-cli set key valueStore a string
valkey-cli get keyRead it back
valkey-cli set key value ex 60Store with a 60-second TTL
valkey-cli ttl keySeconds left before expiry
valkey-cli incr counterAtomic increment
valkey-cli info memoryMemory usage and the maxmemory ceiling
valkey-cli dbsizeNumber of keys
valkey-cli monitorWatch every command live
valkey-cli flushallWipe everything (careful)

That covers day-to-day use. For configuration and clustering, the full command set is in the built-in help: valkey-cli --help and valkey-cli help inside the prompt.

Keep reading

Configure Samba File Share on Debian 13 / 12 Debian Configure Samba File Share on Debian 13 / 12 Setup WireGuard VPN on Ubuntu 24.04 / Debian 13 / Rocky Linux 10 Debian Setup WireGuard VPN on Ubuntu 24.04 / Debian 13 / Rocky Linux 10 Backup and Restore Linux Systems with Timeshift Debian Backup and Restore Linux Systems with Timeshift Monitor Valkey with Prometheus and Grafana Databases Monitor Valkey with Prometheus and Grafana Install Valkey on Rocky Linux 10 / AlmaLinux 10 Databases Install Valkey on Rocky Linux 10 / AlmaLinux 10 Install Prometheus 3 on Ubuntu 24.04 / Debian 13 Debian Install Prometheus 3 on Ubuntu 24.04 / Debian 13

Leave a Comment

Press ESC to close