Databases

Install Redis 8 on Debian 13 / 12 with ACL and AOF

Debian’s own Redis package lags upstream by a full major line, and on Debian 12 it’s still the 7.0 branch. If you want Redis 8 with JSON, search, time series and probabilistic types already bundled, install it from the official Redis apt repository at packages.redis.io, which builds for both trixie and bookworm and wins over the Debian package once you add it.

Original content from computingforgeeks.com - post 22371

This guide installs Redis 8 from that repository, then locks it down with a password and a scoped ACL user. After that you turn on AOF persistence, cap memory, open port 6379 to one app server and benchmark the result. There’s also an upgrade path for servers on Redis 7.4, which broke in two places in our lab. Every command below was run on Debian 13 and Debian 12 with Redis 8.12.0 in November 2026.

Choose the Redis package for Debian

Use packages.redis.io unless you need Debian’s security team to own the package. Debian 13 ships Redis 8.0 and Debian 12 ships Redis 7.0 in the archive, while the Redis repository carries the current 8.x release for both. The Redis rows show what apt policy reported on our two lab servers, and the Valkey row comes from the Debian package tracker.

SourceDebian 13 (trixie)Debian 12 (bookworm)Who patches it
Debian archive redis5:8.0.2-3+deb13u35:7.0.15-1~deb12u10 (security)Debian security team
packages.redis.io redis6:8.12.0-1rl1~trixie16:8.12.0-1rl1~bookworm1Redis
Debian archive valkey8.1.1+dfsg1-3+deb13u38.0.1 (bookworm-backports)Debian security team (trixie), backports as-is (bookworm)

The Redis repository versions carry epoch 6 while the Debian builds carry epoch 5, so once you add the repo apt always prefers it, even over a later Debian security update. That’s what you want on a Redis 8 server, but it also means updates arrive on the Redis schedule, not Debian’s. If you would rather have Debian backport fixes into a frozen version, stay on the archive package and accept the older line.

Licensing changed with Redis 8 as well. It is offered under RSALv2, SSPLv1 or AGPLv3, and the What’s new in Redis 8.0 page explains how Redis Stack was folded into one package. If you need a BSD license without the AGPL terms, the Valkey fork is in the Debian archive, and our Valkey on Debian guide covers that route.

Prepare two Debian servers

Our lab was two small cloud VMs on the same private network, one per Debian release. Treat these as the floor for a test box, not a production size:

  • redis01: Debian 13, 2 vCPU, 8 GB RAM, private IP 10.0.1.50
  • redis02: Debian 12, private IP 10.0.1.51 (upgrade test and remote client)
  • A user with sudo rights on both

For production, size RAM from the dataset you plan to hold plus headroom for the forked child that writes RDB snapshots and rewrites the AOF, because copy-on-write pages grow while writes keep arriving. Disk needs room for at least two copies of the dataset during a rewrite. Redis runs commands on one main thread, so a faster core helps you more than extra cores do.

Add the Redis apt repository

Before adding anything, check what Debian alone would give you, so you can tell later whether the repo actually took over. On the Debian 13 server the candidate comes from the trixie archive.

apt policy redis

The candidate is the Debian 8.0.2 build with epoch 5:

redis:
  Installed: (none)
  Candidate: 5:8.0.2-3+deb13u3
  Version table:
     5:8.0.2-3+deb13u3 500
        500 mirror+file:/etc/apt/mirrors/debian.list trixie/main amd64 Packages
        500 mirror+file:/etc/apt/mirrors/debian-security.list trixie-security/main amd64 Packages

Install curl and gpg, then import the repository signing key into a keyring of its own. Keeping it out of the global trust store means this key can only sign the one source that names it.

sudo apt-get install -y curl gpg
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
sudo chmod 644 /usr/share/keyrings/redis-archive-keyring.gpg

Next, write the source line. It reads the release codename from /etc/os-release, so the same command works on trixie and bookworm without installing lsb-release.

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(. /etc/os-release && echo "$VERSION_CODENAME") main" | sudo tee /etc/apt/sources.list.d/redis.list

On Debian 12 the echoed line ends in bookworm main. If you see an empty codename there instead, the subshell did not run and the source line is broken.

deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb bookworm main

Refresh the package index and ask apt again which build it will install.

sudo apt-get update
apt policy redis

The candidate now comes from packages.redis.io with epoch 6, and older builds sit below it in the version table:

apt policy redis on Debian 13 showing candidate 6:8.12.0-1rl1~trixie1 from packages.redis.io

The full table on our server went back to the 6.2 line. That matters when you need to match an existing fleet, because pinning an older release is only a matter of naming its version string in the install command, as the upgrade section does with 7.4.

Install Redis 8 on Debian

The redis metapackage pulls in redis-server and redis-tools, creates the redis system user, then enables and starts the service. You don’t need to install the server package separately, and the service is already running when apt returns.

sudo apt-get install -y redis

The tail of the install shows the three packages and the redis.service alias pointing at redis-server.service, so either name works with systemctl.

Setting up redis-tools (6:8.12.0-1rl1~trixie1) ...
Setting up redis-server (6:8.12.0-1rl1~trixie1) ...
Created symlink '/etc/systemd/system/redis.service' → '/usr/lib/systemd/system/redis-server.service'.
Created symlink '/etc/systemd/system/multi-user.target.wants/redis-server.service' → '/usr/lib/systemd/system/redis-server.service'.
Setting up redis (6:8.12.0-1rl1~trixie1) ...

Check the server and client versions, then the service state. The client matters too, since it’s what your scripts and health checks will call:

redis-server --version
redis-cli --version
systemctl status redis-server --no-pager

You should see the same version from both binaries and active (running). A client older than the server usually means a second redis-cli earlier on your PATH, from a source build or an old package.

redis-server --version 8.12.0 and redis-server service active running on Debian 13

The unit is Type=notify and runs as the redis user inside a systemd sandbox. It already sets LimitNOFILE=65535, so the open files override that older guides add isn’t needed here. Confirm the listeners and a reply before you change anything.

sudo ss -tlnp | grep 6379
redis-cli ping

A fresh install binds to IPv4 and IPv6 loopback and answers without a password:

LISTEN 0      511        127.0.0.1:6379      0.0.0.0:*    users:(("redis-server",pid=2080,fd=20))
LISTEN 0      511            [::1]:6379         [::]:*    users:(("redis-server",pid=2080,fd=21))
PONG

That’s safe only because nothing outside the host can reach the port yet. The log already warns that Redis does not require authentication, and on our server that was the only warning a fresh install printed, so the kernel side needed nothing on first boot.

Check the bundled modules

Redis 8 from this repository ships the old Redis Stack modules as shared objects under /usr/lib/redis/modules/ and loads them through loadmodule lines near the end of /etc/redis/redis.conf. The config directory belongs to the redis user and isn’t world readable, so you need sudo to read the file.

sudo grep -nE '^(loadmodule|bind|protected-mode|port|supervised|dir|logfile|appendonly)' /etc/redis/redis.conf

Four modules load from the config. The other defaults that matter for the next sections are loopback binding, protected mode on and AOF off.

88:bind 127.0.0.1 -::1
112:protected-mode yes
139:port 6379
422:supervised auto
450:logfile /var/log/redis/redis-server.log
610:dir /var/lib/redis
1551:appendonly no
2917:loadmodule /usr/lib/redis/modules/redisbloom.so
2918:loadmodule /usr/lib/redis/modules/redisearch.so
2919:loadmodule /usr/lib/redis/modules/rejson.so
2920:loadmodule /usr/lib/redis/modules/redistimeseries.so

The config only says what Redis tries to load. Ask the running server which modules it actually holds, because a missing or broken .so file shows up here and not in the grep:

redis-cli MODULE LIST

There are five. Vector sets show no path because they’re compiled into the server, while JSON, search, Bloom and time series come from the files above.

redis-cli MODULE LIST showing ReJSON, search, bf, vectorset and timeseries modules in Redis 8

A listed module is not proof that its commands work, so run a short smoke test. Each command writes one key, and the last line removes all three again.

redis-cli JSON.SET doc '$' '{"os":"debian","release":13}'
redis-cli JSON.GET doc '$.release'
redis-cli BF.ADD seen user1
redis-cli BF.EXISTS seen user1
redis-cli TS.ADD temp '*' 21.5
redis-cli DEL doc seen temp

JSON returns the stored value as an array, the Bloom filter reports the member as added and then present, TS.ADD answers with the sample’s millisecond timestamp (a placeholder here), and DEL removes three keys.

OK
[13]
1
1
<timestamp>
3

If MODULE LIST only shows vectorset, the loadmodule lines are missing from your config and every JSON. or FT. command fails as unknown. That’s exactly what happens after an upgrade from Redis 7.4, and the fix is in the upgrade section.

Set a password and bind to the private IP

Redis must never face a network without authentication. We generate two random passwords, one for the default admin user and one for the application, and keep both in root-only files so they never sit in shell history. Back up the shipped config first, because you will want it for the diff when the next major release arrives.

sudo cp /etc/redis/redis.conf /etc/redis/redis.conf.orig
openssl rand -base64 32 | sudo tee /etc/redis/.admin-pass >/dev/null
openssl rand -base64 32 | sudo tee /etc/redis/.app-pass >/dev/null
sudo chown root:root /etc/redis/.admin-pass /etc/redis/.app-pass
sudo chmod 600 /etc/redis/.admin-pass /etc/redis/.app-pass

Print the admin password with sudo cat /etc/redis/.admin-pass so you can paste it into the config, then open the file.

sudo vim /etc/redis/redis.conf

Find the bind, protected-mode and commented requirepass lines and set them as below. Add your server’s private address to bind (ours is 10.0.1.50) while keeping loopback, and replace the requirepass value with the generated string.

bind 127.0.0.1 -::1 10.0.1.50
protected-mode yes
requirepass your-strong-password

The leading dash on -::1 tells Redis to skip that address if IPv6 is unavailable instead of refusing to start. Keep protected-mode yes too, since it is the last guard if someone later comments out the password. Restart the service and check the listeners.

sudo systemctl restart redis-server
sudo ss -tlnp | grep 6379

Port 6379 is now bound on the private address as well as loopback:

LISTEN 0      511      10.0.1.50:6379      0.0.0.0:*    users:(("redis-server",pid=2413,fd=22))
LISTEN 0      511        127.0.0.1:6379      0.0.0.0:*    users:(("redis-server",pid=2413,fd=20))
LISTEN 0      511            [::1]:6379         [::]:*    users:(("redis-server",pid=2413,fd=21))

A bare redis-cli ping now fails with NOAUTH Authentication required., which is the result you want. Typing -a on every command puts the password in shell history and in ps output, so export it in the REDISCLI_AUTH variable that redis-cli reads instead.

export REDISCLI_AUTH="$(sudo cat /etc/redis/.admin-pass)"
redis-cli ping

The server answers once the variable is set:

PONG

The rest of the admin commands in this guide assume the variable is exported in your shell. Open a new session and you have to export it again, which is the price of never writing it to disk.

Create a scoped ACL user for the application

Handing the admin password to every app means any of them can run FLUSHALL or CONFIG SET. An ACL user limits one app to its own key prefix and to read and write commands. This one may only touch keys matching app:*, and it loses every command Redis tags as dangerous.

redis-cli ACL SETUSER appuser on ">$(sudo cat /etc/redis/.app-pass)" '~app:*' +@read +@write -@dangerous
redis-cli ACL LIST

The password still passes through the redis-cli arguments for a moment here, so run this on the Redis host itself rather than from a shared box. Now test the user the way the application will connect, with the app password and --user appuser. The capture runs five commands against it.

Redis ACL user appuser allowed on app keys and denied NOPERM on other keys and FLUSHALL

Reading the results line by line, the first one is not what most people expect:

  • ACL WHOAMI is refused
  • Writes and reads under app: succeed
  • Keys outside the prefix get NOPERM No permissions to access a key
  • FLUSHALL is refused outright

WHOAMI isn’t dangerous. It’s refused because the user only holds the read and write categories, and WHOAMI belongs to neither. The same gap hits PING, which you’ll see from the app server in the firewall section, so remember that a category list grants less than it looks like.

ACL changes live only in memory until you persist them, and a restart silently drops them. ACL SAVE looks like the right command, but on this package it fails because no aclfile is configured.

ERR This Redis instance is not configured to use an ACL file. You may want to specify users via the ACL SETUSER command and then issue a CONFIG REWRITE (assuming you have a Redis configuration file set) in order to store

Do what the error suggests and write the users into redis.conf instead, then check the result.

redis-cli CONFIG REWRITE
sudo grep -nE '^user' /etc/redis/redis.conf

Both users are now stored as hashed lines at the end of the file (hashes replaced here), and they survived a restart on our server.

3364:user appuser on sanitize-payload #<sha256-hash> ~app:* resetchannels -@all +@read +@write -@dangerous
3365:user default on sanitize-payload #<sha256-hash> ~* &* +@all

CONFIG REWRITE also rewrites other lines it manages, such as save, which becomes three separate lines, so expect a noisy diff against redis.conf.orig. If you would rather keep users in a file of their own, set aclfile /etc/redis/users.acl, create that file owned by redis, and ACL SAVE works from then on.

Configure RDB and AOF persistence

The package keeps the upstream defaults, which means scheduled RDB snapshots and no append-only file. Read them from the running server before deciding what to change.

redis-cli CONFIG GET save
redis-cli CONFIG GET appendonly
redis-cli CONFIG GET appendfsync

A snapshot is taken after 3600 seconds with 1 change, 300 seconds with 100 changes or 60 seconds with 10000 changes.

save
3600 1 300 100 60 10000
appendonly
no
appendfsync
everysec

With RDB alone, a crash loses everything written since the last snapshot, which can be close to an hour on a quiet server. AOF with everysec narrows that to about one second of writes, so turn it on for anything that isn’t a throwaway cache. How you turn it on depends on whether the server already holds data, and we learned that the hard way.

Run redis-cli DBSIZE first. If it returns anything but 0 (the ACL tests above leave keys behind), skip the edit below and use the live procedure that follows it. On an empty server the config edit is enough, so open the file:

sudo vim /etc/redis/redis.conf

Change appendonly no to the line below and leave appendfsync everysec as it is.

appendonly yes

Restart Redis so it builds the AOF directory. The config file is only read at startup, so nothing changes on disk until the service comes back.

sudo systemctl restart redis-server

Our first try did this on a server that already had one key in dump.rdb, and the key was gone after the restart. The log explains why. With AOF enabled, Redis started from a brand new, empty AOF and never read the snapshot sitting next to it.

2607:M 22 Nov 2026 17:23:38.801 * Creating AOF base file appendonly.aof.1.base.rdb on server start
2607:M 22 Nov 2026 17:23:38.805 * Creating AOF incr file appendonly.aof.1.incr.aof on server start

On a server with data, follow the Redis persistence docs instead. Back up the snapshot with sudo cp /var/lib/redis/dump.rdb /root/dump.rdb.bak, run redis-cli CONFIG SET appendonly yes on the live server and wait until INFO persistence shows aof_rewrite_in_progress:0, aof_rewrite_scheduled:0 and aof_last_bgrewrite_status:ok. Then run redis-cli CONFIG REWRITE so the setting sticks, and only restart after that.

To prove both mechanisms work, load 1000 keys through the pipe mode of redis-cli and force a snapshot.

for i in $(seq 1 1000); do echo "SET key:$i val$i"; done | redis-cli --pipe
redis-cli BGSAVE

The pipe reports 1000 replies and no errors. Check the persistence status, the files on disk, and whether the keys come back after a restart. Do them in that order, because only the restart proves the files on disk are usable:

Redis RDB dump.rdb and AOF appendonlydir files with 1000 keys surviving a restart

The AOF is a directory, not one file. It holds a base snapshot, an incremental log and a manifest that ties them together, so back up the whole appendonlydir rather than a single .aof file. When both RDB and AOF exist, Redis loads from the AOF because it’s the more complete copy, which is also why the empty AOF above won over a full snapshot.

Set a memory limit and check kernel settings

Without maxmemory, Redis grows until the kernel OOM killer steps in, and that usually takes the whole process down mid-write. Set a hard limit below the machine’s RAM and decide what happens when it is reached.

sudo vim /etc/redis/redis.conf

Uncomment and set these two lines. We used 1 GB with LRU eviction across all keys, which suits a cache.

maxmemory 1gb
maxmemory-policy allkeys-lru

Use noeviction instead if Redis holds queues, sessions or anything you can’t rebuild. Writes then fail with an error that your app can see, rather than keys disappearing without a trace. Restart and read the values back.

sudo systemctl restart redis-server
redis-cli CONFIG GET maxmemory
redis-cli CONFIG GET maxmemory-policy

The limit comes back in bytes:

maxmemory
1073741824
maxmemory-policy
allkeys-lru

Older Redis guides add a systemd unit to disable transparent huge pages and tune three sysctls. On Redis 8 most of that is already handled, so check what your host reports before you add anything.

sudo sysctl vm.overcommit_memory net.core.somaxconn
cat /sys/kernel/mm/transparent_hugepage/enabled
redis-cli CONFIG GET disable-thp

Our cloud image reported this:

vm.overcommit_memory = 1
net.core.somaxconn = 4096
[always] madvise never
disable-thp
yes

THP is set to always system-wide, but disable-thp yes makes Redis switch it off for its own process, and the startup log carried no THP warning. A somaxconn of 4096 is above the 511 backlog Redis asks for. Overcommit was already 1 on this image while the kernel default is 0, and a background save can fail to fork under 0, so pin it in a file of its own to hold on any host.

echo 'vm.overcommit_memory = 1' | sudo tee /etc/sysctl.d/60-redis.conf
sudo sysctl --system | grep -i overcommit

After a restart the only warning left in /var/log/redis/redis-server.log was the old one about missing authentication from first boot. No extra tuning unit is needed, and skipping it leaves one less thing to drift between hosts.

Open the firewall to app servers only

Binding to the private IP is not enough on its own, because anything else on that network can still reach the port. Debian doesn’t ship an active firewall by default. Install ufw and allow SSH first so you don’t lock yourself out, then allow 6379 from the application server only (10.0.1.51 here). The OpenSSH profile covers port 22 only, so if your sshd listens elsewhere, allow that port instead before you enable the firewall.

sudo apt-get install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow from 10.0.1.51 to any port 6379 proto tcp
sudo ufw --force enable
sudo ufw status numbered

The rule list should show SSH open and Redis open to one source address only:

ufw status numbered allowing Redis port 6379 only from the application server 10.0.1.51

From the app server, test both the refusal and the scoped login. Install redis-tools there if it lacks redis-cli, create the directory with sudo install -d -m 700 /etc/redis, and copy the app password to the same root-only path, /etc/redis/.app-pass, through your usual secrets channel.

redis-cli -h 10.0.1.50 ping
REDISCLI_AUTH="$(sudo cat /etc/redis/.app-pass)" redis-cli -h 10.0.1.50 --user appuser --no-auth-warning ping
REDISCLI_AUTH="$(sudo cat /etc/redis/.app-pass)" redis-cli -h 10.0.1.50 --user appuser SET app:remote 1

Without credentials the server refuses, and the app user can write, but its PING fails:

NOAUTH Authentication required.
NOPERM User appuser has no permissions to run the 'ping' command
OK

PING is in neither the read nor the write category, so a connection pool that pings before use breaks against this user. Grant that one command on the Redis server rather than loosening the categories, and persist it again.

redis-cli ACL SETUSER appuser +ping
redis-cli CONFIG REWRITE
redis-cli ACL LIST

The user line now ends in +ping (hashes replaced):

OK
OK
user appuser on sanitize-payload #<sha256-hash> ~app:* resetchannels -@all +@read +@write -@dangerous +ping
user default on sanitize-payload #<sha256-hash> ~* &* +@all

Run the same --user appuser ping from the app server again and it now answers PONG.

On a cloud VM there’s a second firewall in front of the host. Our provider’s default internal rule allowed all TCP inside the private range, so ufw was the only thing scoping 6379 to one client. Check your provider’s rules as well, and never open 6379 to the internet, even with a password set.

Upgrade Redis 7.4 to Redis 8 on Debian

Servers that installed Redis 7.4 from packages.redis.io get Redis 8 through a normal apt upgrade, since the repository is the same. We reproduced that on Debian 12 with Redis 7.4.12, a password set and 500 keys saved. The data came through untouched, but the upgrade broke twice before it finished. Save a fresh snapshot and copy dump.rdb somewhere safe before you start. The redis-cli calls in this section assume REDISCLI_AUTH is exported as in the password step, otherwise they fail with NOAUTH.

redis-cli SAVE
redis-cli DBSIZE

A plain sudo apt-get install -y redis fails at the first hurdle. Any server you have secured has a modified redis.conf, the new package ships its own, and dpkg stops to ask which one to keep. The -y flag doesn’t answer conffile prompts, so a non-interactive run from Ansible, CI or an SSH one-liner dies there.

apt upgrade from Redis 7.4 to 8.12 failing at the redis.conf conffile prompt on Debian 12

That leaves redis and redis-server half configured, state iU in dpkg -l. Tell dpkg to keep your config and finish the job. On a server you have customised, this is the command to run from the start.

sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold redis

dpkg keeps the old file and saves the new one next to it as redis.conf.dpkg-dist. Your bind address and password stay in place, so clients reconnect without changes.

Setting up redis-server (6:8.12.0-1rl1~bookworm1) ...

Configuration file '/etc/redis/redis.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Keeping old config file as default.
Setting up redis (6:8.12.0-1rl1~bookworm1) ...

The service came back as Redis 8 with all 500 keys, yet MODULE LIST showed only vectorset. That is the second break. The kept 7.4 config has no loadmodule lines, so JSON, search, Bloom and time series never load, and nothing in the log calls it an error. Compare the directives in both files to see what else differs.

diff <(sudo grep -E '^[a-z]' /etc/redis/redis.conf.dpkg-dist | sort) <(sudo grep -E '^[a-z]' /etc/redis/redis.conf | sort)

Lines marked < exist only in the new file. Beyond the four modules, they’re directives for features added after 7.4, plus daemonize, which is harmless here because the systemd unit runs Redis supervised. The modules are the part you have to fix, and the list below the output covers the rest.

12,14d11
< array-slice-size 4096
< array-sparse-kmax 10
< array-sparse-kmin 5
17,18d13
< backup-sealed-ttl 0
< backupdirname "backupdir"
23c18
< daemonize no
---
> daemonize yes
31,35d25
< hash-max-template-entries 0
< hash-min-template-entries 0
< hash-rdb-load-max-template-entries 0
< hash-rdb-load-min-template-entries 0
< hash-rdb-load-template-disassembly-threshold 0
47,50d36
< loadmodule /usr/lib/redis/modules/redisbloom.so
< loadmodule /usr/lib/redis/modules/redisearch.so
< loadmodule /usr/lib/redis/modules/redistimeseries.so
< loadmodule /usr/lib/redis/modules/rejson.so
56d41
< off-cpu-tracking yes
58a44
> pidfile /run/redis/redis-server.pid
74a61
> requirepass your-strong-password

Each group of new directives is set in the shipped file to the same value compiled into the server (config.c at the release tag), so leaving them out of your old config changes nothing. Here’s what they control:

  • off-cpu-tracking yes: the one that matters. It’s on even without the line and samples main-thread CPU time on every event-loop wakeup, so slowlog entries show whether a command was slow or starved of CPU. The file’s own comment puts the cost at a few percent for unpipelined, one-request-per-wakeup traffic. Set it to no if your benchmark drops after the upgrade.
  • array-slice-size 4096, array-sparse-kmax 10, array-sparse-kmin 5: memory layout for the new Array data type. They only apply once an app writes arrays.
  • backupdirname “backupdir”, backup-sealed-ttl 0: where the new BACKUP command writes its MP-AOF file set under dir, and how long sealed backups are kept (0 keeps them until BACKUP CLEANUP). Nothing is written until someone runs BACKUP START.
  • hash-min/max-template-entries and the three hash-rdb-load-* settings, all 0: compact hash templates, which share one field-name set across many hashes. At 0 no hash is converted on write or on RDB load, so an upgraded dataset keeps its old encoding.

The release notes from 8.8 to 8.12 cover part of this: 8.8 announced the Array type, the 8.10 candidate notes added BACKUP and the three hash-rdb-load-* settings, and the 8.12 candidate notes added off-cpu-tracking. They don’t list the array, backup or write-path template directives, so the defaults above come from the shipped redis.conf and the source, not from the notes.

Append the four loadmodule lines from the new file to your config and restart. That’s safer than swapping in the new file, because the shipped copy carries none of your bind address or password lines.

sudo grep '^loadmodule' /etc/redis/redis.conf.dpkg-dist | sudo tee -a /etc/redis/redis.conf
sudo systemctl restart redis-server
redis-cli MODULE LIST

All five modules load again, and DBSIZE still reported 500 keys afterwards.

name ReJSON ver 81200 path /usr/lib/redis/modules/rejson.so args
name bf ver 81200 path /usr/lib/redis/modules/redisbloom.so args
name vectorset ver 1 path  args
name search ver 81201 path /usr/lib/redis/modules/redisearch.so args
name timeseries ver 81200 path /usr/lib/redis/modules/redistimeseries.so args

Check two behaviour changes before you point apps at the upgraded server. In Redis 8, module commands belong to the standard ACL categories, so a user defined as +@all -@write can no longer run JSON.SET. Search also scores with BM25 by default instead of TF-IDF, which reorders results for apps that relied on the old ranking. To stop routine apt upgrade runs from jumping major versions later, hold the packages with sudo apt-mark hold redis redis-server redis-tools and release them when you plan the next upgrade.

Cluster mode has one more catch. The 8.10.3 release fixed a heap buffer overflow when a PUBLISH or SPUBLISH message over 4 GB is propagated across the cluster bus, and Redis flagged it as a security update. The same fix shipped on 26 Oct 2026 in 8.8.4, 8.6.8, 8.4.8, 8.2.11, 7.4.12 and 7.2.17, so the 7.4.12 server in this lab already had it. It isn’t in 8.12.0: the bounds check that 8.10.3 added to cluster_legacy.c is missing at the 8.12.0 tag, and the 8.12 notes don’t mention it. Standalone servers don’t use the cluster bus. For cluster nodes, the mitigation that works on any version is to keep proto-max-bulk-len at its 512mb default (redis-cli CONFIG GET proto-max-bulk-len), which caps every argument a client sends far below 4 GB. Scripts can still build a bigger message inside EVAL or FCALL, so also deny @scripting to untrusted ACL users. It’s a mitigation, not the fix.

A new cluster node can take 8.10.3 instead and hold it there until an 8.12 patch release ships the fix: sudo apt install redis=6:8.10.3-1rl1~trixie1 redis-server=6:8.10.3-1rl1~trixie1 redis-tools=6:8.10.3-1rl1~trixie1 (use bookworm1 on Debian 12, and add redis-sentinel at the same version if the node runs Sentinel), then sudo apt-mark hold redis redis-server redis-tools so the next apt upgrade doesn’t pull 8.12.0 back in. Don’t use the pin to step a node that already runs 8.12.0 back down. 8.12 saves RDB format 17, 8.10.3 only reads up to 15, so the older server refuses the dump and won’t start, and an 8.10.3 replica can’t full-sync from an 8.12 primary.

Benchmark with redis-benchmark

redis-benchmark ships in redis-tools and gives you a quick baseline for the box. It doesn’t read REDISCLI_AUTH, so with the variable exported it still fails:

Node 127.0.0.1:6379 replied with error:
NOAUTH Authentication required.

It has no --pass flag either. Pass the password with -a, adding --user to test an ACL user, and run it on the Redis host itself so the password never crosses the network.

ADMIN_PASS="$(sudo cat /etc/redis/.admin-pass)"
redis-benchmark -a "$ADMIN_PASS" -q -n 100000 -c 50 -t set,get,incr,lpush,lpop

That sends 100,000 requests per test from 50 parallel clients. Our 2 vCPU, 8 GB Debian 13 server produced these numbers with AOF on.

redis-benchmark results for SET GET INCR LPUSH LPOP on a 2 vCPU Debian 13 VM

Every command landed at about 42,000 to 44,000 requests per second with a median latency around 0.6 ms. The flat profile tells you the single command thread on a small shared vCPU is the limit here, not the data structure. Treat these numbers as a floor to compare against after changes on your own hardware, not a target, because the benchmark client competes with the server for the same two cores.

Fix common Redis errors on Debian

These are the errors we hit while building this guide, with the cause of each one and the fix that worked.

NOAUTH Authentication required

The server has requirepass set and the client sent no password. For redis-cli, export REDISCLI_AUTH or pass --user with --pass. For redis-benchmark the variable is ignored, so use -a.

NOPERM User appuser has no permissions to run the ‘ping’ command

PING is not part of the read or write categories, so an ACL user built from those cannot run health checks. Add it with ACL SETUSER appuser +ping and persist with CONFIG REWRITE. ACL WHOAMI fails for the same reason and takes +acl|whoami if your app needs it.

ERR This Redis instance is not configured to use an ACL file

ACL SAVE needs an aclfile directive, and the Debian package does not set one. Use CONFIG REWRITE to store users in redis.conf, or configure an ACL file before you rely on ACL SAVE.

end of file on stdin at conffile prompt

dpkg wanted an answer about the modified /etc/redis/redis.conf during an upgrade and had no terminal to ask. Rerun the install with DEBIAN_FRONTEND=noninteractive plus the --force-confdef and --force-confold options from the upgrade section, then add the loadmodule lines from redis.conf.dpkg-dist.

Keys missing after setting appendonly yes

If the log shows Creating AOF base file appendonly.aof.1.base.rdb on server start right after you edited appendonly and restarted, Redis started from an empty AOF and ignored dump.rdb. A normal shutdown saves a final RDB over the old snapshot, and our lab log shows exactly that with Saving the final RDB snapshot before exiting. The unit also has Restart=always, so killing the process from redis-cli only gets it restarted on the same empty AOF. Recover in this order:

  1. Run redis-cli CONFIG SET save "" so the shutdown writes no RDB
  2. Stop with sudo systemctl stop redis-server, which systemd won’t restart
  3. Restore the backup with sudo install -o redis -g redis -m 660 /root/dump.rdb.bak /var/lib/redis/dump.rdb
  4. Set appendonly no in the config and move appendonlydir aside
  5. Start with sudo systemctl start redis-server and check redis-cli DBSIZE

No backup? Copy /var/lib/redis/dump.rdb aside right after step 1 and skip step 3, because until a save point fires on the restarted server, that file still holds the snapshot from before the switch. Then enable AOF live with CONFIG SET as the persistence section describes. Without a backup, and once a save has already run, the old keys can’t be recovered, which is why the backup comes before any persistence change.

Permission denied on /etc/redis

The directory belongs to the redis user and is not world readable, so listing or grepping it needs sudo. The same goes for sysctl, which is not on a regular user’s PATH on Debian and returns command not found without it.

Harden Redis for production

The steps above give you one secured node. Before real traffic arrives, settle these as well:

  • One ACL user per application, each with its own key prefix
  • Hourly and daily copies of dump.rdb and appendonlydir off the host
  • TLS on the listener if traffic leaves a trusted private network
  • Held packages, upgraded on your schedule rather than apt’s
  • Alerts on used_memory, evictions and rdb_last_bgsave_status

Mixed fleets can follow our Redis on RHEL, Rocky and AlmaLinux guide or the Rocky and AlmaLinux walkthrough, and Ubuntu hosts have the Ubuntu 26.04 Redis guide. If you only need a disposable instance for development, running Redis in Podman or Docker is faster than any of this, and our list of Redis and caching books goes deeper on data modelling.

Our verdict: on Debian 13 or 12, install Redis 8 from packages.redis.io, bind it to a private address behind ufw, give every app a scoped ACL user and turn on AOF before the data arrives. The official apt instructions track any change to the repository itself. Leave the Debian archive package to servers that must take every update from Debian’s security team, and accept that you are running an older line when you do.

Keep reading

Install Samba on Debian 13 / 12 and Create a File Share Debian Install Samba on Debian 13 / 12 and Create a File Share Backup and Restore Linux Systems with Timeshift Debian Backup and Restore Linux Systems with Timeshift Install KVM on Debian 13 / Debian 12: Complete Guide KVM Install KVM on Debian 13 / Debian 12: Complete Guide MariaDB 13.1 New Features Tested: DENY, JSON Arrows, utf8mb4 Databases MariaDB 13.1 New Features Tested: DENY, JSON Arrows, utf8mb4 Moonfin for Jellyfin: Moonbase Plugin, Web App and Desktop Setup Debian Moonfin for Jellyfin: Moonbase Plugin, Web App and Desktop Setup Install Jekyll on Debian 13/12 and Deploy with Nginx or GitHub Pages Web Hosting Install Jekyll on Debian 13/12 and Deploy with Nginx or GitHub Pages

Leave a Comment

Press ESC to close