Protect Redis or Valkey
Backups, restore to any second, Proof, Rewind and Pulse for Redis 7.0+ and Valkey 7.2+.
Rowsafe protects Redis and Valkey like your other databases. Valkey works exactly like Redis, so "Redis" on this page means both. Some features aren't there yet: see Not yet and Limits.
What you get
| Backups | A full snapshot, encrypted on your server, in your bucket (or Rowsafe Storage). |
| Restore to any second | Every change is saved and uploaded about every minute. |
| Marks | Name a moment before a risky change; a restore to it stops exactly there. |
| Proof | Every week, your newest backup is restored into a temporary server and checked. |
| Rewind | Restore a copy, compare it, bring keys back, or rewind the whole server, with Undo for 7 days. |
| Pulse | Memory, evictions, clients, replication and slow commands, with one-click fixes. |
| Restart | Restart in the dashboard, after you confirm. |
| Security check | No password, open ports, risky user rights, known flaws, with one-click fixes. |
| Tuning | The settings that matter in plain words, Tune for this server, undo in one click. |
| Updates and upgrades | Bug and security releases in one click (including the October 2025 Lua fixes); new versions (Redis 7.4 to 8.2, Valkey 8.1 to 9.0) rehearsed on a copy first, undo for 7 days. |
| Logs | Redis's own log, redacted on your server, searchable and forwardable. |
| Recommendations | Memory by key pattern, keys that never expire, risky settings. Only patterns like session:* leave your server. |
| Databases & users | ACL users (read only, read and write, or admin, on the keys you choose) and the numbered databases. |
| Files and second copy | Back up your app's folders, and keep backups in a second bucket too. |
| Find the moment | Type a key or pattern (user:*) and see when it was written or deleted. |
| Safe copies | A masked or structure-only copy for development and AI agents. |
| Clones | The database at any moment, in a new server. |
| Standby servers | A replica on another server, with promotion and a planned move to a new server. |
| Move in | From ElastiCache, MemoryDB, Upstash, Redis Cloud, Azure, DigitalOcean, Aiven or any Redis. |
Before you start
- Redis 7.0 or newer, or Valkey 7.2 or newer. That's the version in:
- Debian 12 (Redis 7.0) and Debian 13 (Redis 8.0, Valkey 8.1);
- Ubuntu 24.04 (Redis 7.0, Valkey 7.2);
- Redis's own packages (packages.redis.io);
- the official Docker images:
redis7.2 to 8.10 andvalkey/valkey7.2 to 9.2.
- Ubuntu 22.04 ships Redis 6.0, which is too old. Use Redis's own packages.
- A standalone server (its own replicas are fine). Redis Cluster and Sentinel aren't supported yet.
- Redis listens on a TCP port (
6379by default) without requiring TLS. - A bucket and an encryption passphrase. See Adopt an existing database.
Turn on backups
Run this on the server, then approve the server in your browser when it prints the link:
curl -fsSL https://rowsafe.sh | sudo sh -s -- --accountThe installer finds redis-server or valkey-server. Nothing restarts.
Rowsafe's Redis user. It creates an ACL user rowsafe with a random password that stays on the server, and keeps it across restarts. Its rights are below.
Read access to Redis's data folder, for the agent only. Used only when Rowsafe can't follow the server.
Restart permission: Rowsafe restarts Redis only when someone clicks and confirms. Say no to restart it yourself.
The plan. You review it and say yes. Redis's settings don't change. Rowsafe checks a backup reaches your bucket and opens with your key, then takes the first full backup.
On a server without PostgreSQL, the agent runs as its own system user, rowsafe.
What Rowsafe does
| How | |
|---|---|
| Backup | A full snapshot (RDB file), sent by Redis the way it feeds a new replica, so no file access is needed (works across containers). Redis forks to make it. |
| Encryption | On your server, before upload. |
| Every change | The agent stays attached as a replica that never serves anything and uploads changes about every minute, encrypted. |
| Restore to any second | The newest snapshot before that moment, plus the changes up to it. |
| Marks | A position in the stream of changes, so a restore to a Mark is exact. |
| Proof | Restores the newest backup into a temporary server, checks each logical database's key count, replays the changes since and compares with production. |
| Second copy | Weekly snapshots and the changes also go to a second bucket with its own passphrase. Proof alternates between the two. |
Temporary servers (Proof, Rewind copies) are memory-capped, and the agent checks free disk and memory first.
Rowsafe's link shows in INFO replication as ip=rowsafe-agent. Rowsafe doesn't count it as a replica, but other tools will.
When Rowsafe can't follow the server
Rowsafe can't attach when the replication commands (SYNC, PSYNC) are renamed or blocked for its user, or when min-replicas-to-write is set (its link would weaken that guarantee). Then:
- backups are scheduled snapshots only (
BGSAVE, read from Redis's file); - restores go back to those snapshots, not to any second;
- Marks aren't available;
- the dashboard says so, and why.
This needs read access to Redis's data folder. The installer gives it; in Docker, mount Redis's data volume into the agent, read only.
Rewind
In the dashboard, for owners and admins. See Restore a database.
- Restore a copy at any second or a Mark, on a private Unix socket.
- Compare with production, one logical database at a time: deleted keys, changed values, added keys. Large databases are sampled; the result says how many keys were compared.
- Bring back keys for a pattern (like
user:*), with their remaining time to live. Existing keys are never overwritten unless you choose to.
Rewind the whole server
Rewind the whole database puts every logical database back to the moment you pick. Each one is loaded into an empty logical database, then swapped in instantly (SWAPDB). No restart, never a moment without data.
It needs one empty logical database and free memory for one more copy of your largest logical database. The old data is kept in your bucket for 7 days: Undo rewind puts it back.
Find the moment
Find the moment shows when keys were written or deleted. Type a key (user:42) or a pattern (session:*), pick a time range, and get Rewind to just before this on each change.
- Changes are grouped by logical database, pattern and second. A
MULTI/EXECis one change.FLUSHDBandFLUSHALLshow as emptied databases. - Only what you typed reaches Rowsafe, plus key counts. Never matched key names or values.
- "Just before" means the second before.
- Expired keys show as deleted.
- A server Rowsafe can't follow has nothing to search.
Safe copies
A safe copy opens the newest backup for developers or AI agents, over TLS, for the addresses you allow:
-
Masked: values replaced by your rules (per key pattern and field), by field names (email, phone, name, token...), and wherever a value looks like an email, phone, token or JSON. Times to live are kept. Rules are under Guard > Masking.
-
Structure only: every key with its type and time to live, no data.
-
The agent guards the port: only your addresses, over TLS. Connect with
rediss://(self-signed unless you set your own certificate). -
The only login is the copy's, with a password made in your browser. It can't run admin commands (
CONFIG,MODULE,DEBUG,SAVE,REPLICAOF,MIGRATE...). -
Module-type keys (RedisJSON, search) are removed: they can't be masked.
Clones
A clone is the database at any second or Mark, in its own server. It's restored privately on the target host, masked first if you ask, then copied key by key with times to live.
The target host needs the installer run with --redis-clones. Rowsafe then creates a new Redis server there (service rowsafe-redis@PORT, ports 6390 to 6399), or fills an empty one you hand it (sudo -u rowsafe rowsafe-agent redis login --port PORT --target clones). Bucket settings reach the target sealed to its agent's key.
A clone has none of the source's users. A server Rowsafe created starts with a passwordless default user, which protected mode allows from that host only, until you add users.
Standby servers
A standby is a real Redis replica that Rowsafe sets up on another server and watches.
- Run the installer with
--redis-standbyon both servers. On the primary, this lets Rowsafe's user manage users, which in Redis amounts to admin rights, used only when you add, promote or remove a standby. On the standby's server, it lets Rowsafe create a Redis server (or fill an empty one). - Standby > Add a standby in the dashboard, pick the server and confirm its key fingerprint.
The standby gets its own replication login (password sealed to its agent) and a copy of the primary's users, so apps can sign in after promotion. It copies the data from the primary like any replica, then follows every change, read-only. Pulse shows its lag.
- Promote makes the standby the primary (
REPLICAOF NO ONE). - Move to a new server is a planned switchover: the old primary is fenced (refuses writes for good), the standby catches up, then it's promoted. The old server can then Rebuild as standby.
- After a switch, the new primary's first snapshot is a new base for restores. Earlier moments restore from the old server's history; the minute or so before that first snapshot can't be restored to a second.
- The primary must listen on an address the standby reaches, and its default user needs a password. Users created on the primary later aren't copied: add them on the standby too.
Move in
Move in brings a database from ElastiCache, MemoryDB, Upstash, Redis Cloud, Azure Cache for Redis, DigitalOcean, Aiven for Valkey or any Redis into an empty server Rowsafe protects. Paste the connection string (rediss://default:password@host:6379). It's encrypted in your browser so only your server can read it.
The check covers reachability, versions (this server must be the same or newer), missing modules, fit in maxmemory, eviction policy, logical databases, and whether live sync is possible.
- One-time copy: every key, with its time to live, in batches (resumes if it stops). Managed providers can't be made read-only, so stop your apps' writes during the copy. Key counts are compared at the end.
- Live sync: when the source lets replicas connect (self-hosted, plain connection; not managed providers), this server follows it until you switch over, so apps keep writing. The switchover waits for every change and compares key counts.
Afterwards Rowsafe can make a login for your apps (with --redis-standby on this server) and shows its connection string once.
Pulse
Pulse reads Redis's statistics every minute (details every 5 minutes): memory, evictions, hit rate, commands, clients, fragmentation, persistence, replication lag, slow log and latency. The slow log reaches Rowsafe as command names only.
Fixes come with Apply fix and a confirmation:
| Finding | Fix |
|---|---|
Near maxmemory and set to refuse writes when full (noeviction) | Set an eviction policy, so Redis removes old keys instead. |
| A lot of fragmented memory | Give memory back (MEMORY PURGE) or turn on active defragmentation (small CPU cost). Offered only when Redis uses jemalloc (most Linux builds). |
| A client looks stuck (long block or large output buffer) | Disconnect it. Rowsafe checks it's the same connection, and never disconnects replicas or its own link. |
| Rowsafe's link or a replica often needs a whole new snapshot | Raise the replication backlog. |
Fixes apply at once. Rowsafe also saves them to Redis's config file when it can; otherwise they last until the next restart, and the result says which.
Security problems are in the security check.
Restart
Restart in the dashboard restarts Redis after you confirm, only for the services root allowed at install (redis-server, valkey-server...). See Permissions. In Docker it needs the container control service (below). Rowsafe won't restart a server that keeps nothing on disk (snapshots and append-only file both off), since it would come back empty: Pulse offers Turn on snapshots first.
What Rowsafe may do
Rowsafe's Redis user (rowsafe) gets only what it needs, used only when someone asks or for backups:
- read and inspect the server: backups, Proof, compare and Pulse;
- the replication handshake: snapshots and following every change;
DUMPandRESTORE: bring keys back;SWAPDB,FLUSHDBandDEL: rewind the whole server (only into and out of an empty logical database;DELonly on its own marker key);CONFIG GET,CONFIG SET,CONFIG REWRITE,MEMORY PURGEandCLIENT KILL: fixes and Tuning;ACL LIST,ACL GETUSER,ACL USERS,ACL SETUSER,ACL DELUSERandACL SAVE: Databases & users and security fixes. Never on its own user or replicas' users; the default user's password only through the security fix. Older agents list users only until you rerun the installer; the dashboard says so;BGSAVE: scheduled snapshots, when Rowsafe can't follow the server.
With --redis-standby it may also create, list and remove users and run REPLICAOF. On a server handed to Rowsafe for a standby or clone, it has every right.
It never sees anything outside Redis.
Root decides what Rowsafe may do on the server itself (permissions, sudo rowsafe-allow):
| Permission | Lets Rowsafe |
|---|---|
restart | restart Redis (Restart) |
--redis-standby, --redis-clones (installer) | create a Redis server for a standby or clone, on ports 6390 to 6399 (rowsafe-redis@PORT, running as redis), and remove it when done |
updates | install minor updates and upgrade to a new series (the word database) |
tuning | save setting changes in Redis's config file (only the settings Tuning offers, keeping a copy) |
Rewinding the whole server needs no root permission: it swaps data inside Redis.
Docker
Run the Redis agent image next to the official redis or valkey/valkey image. Pick the tag that matches your server: ghcr.io/rowsafe/agent:redis<version> (like redis8.2) or ghcr.io/rowsafe/agent:valkey<version> (like valkey8.1).
services:
redis:
image: redis:8.2
# Users, Rowsafe's included, live in an ACL file in the data volume, so they survive restarts.
# The full example below sets this up.
volumes:
- redisdata:/data
rowsafe-agent:
image: ghcr.io/rowsafe/agent:redis8.2
hostname: db-1
environment:
ROWSAFE_REDIS_HOST: redis
ROWSAFE_REDIS_DATA_DIR: /srv/redis-data # only used when Rowsafe can't follow the server
env_file: rowsafe-agent.env
volumes:
- rowsafe-state:/var/lib/rowsafe
- redisdata:/srv/redis-data:ro # read onlyStart Redis with an ACL file in its data volume so Rowsafe's user survives restarts. Full example: deploy/docker/compose.redis.example.yml. Then, once:
docker compose exec rowsafe-agent rowsafe-agent redis login --port 6379 --admin-user default
rowsafe adopt cache --host db-1 --engine redis --port 6379
rowsafe apply cacheredis login asks for the admin password once, creates Rowsafe's user, and never saves it. For Valkey, use --engine valkey.
Restart and update in Docker
Without help, restart the Redis container yourself; Rowsafe notices. For Restart in the dashboard, add the container control service (ROWSAFE_CONTROL_SERVICE: redis). It holds the Docker socket so the agent never does. See Let Rowsafe restart the container and its threat model.
The agent never updates itself in Docker. Pull the newest image and recreate only the agent (Redis keeps running):
docker compose pull rowsafe-agent && docker compose up -d rowsafe-agentName the service: a plain docker compose pull and up -d can also upgrade and restart Redis. With the container control service, Update now does it for you: see Update the agent from the dashboard. On a server, the agent updates itself.
Restore without Rowsafe
Your backups don't need Rowsafe. With your bucket settings and passphrase in the environment (as in agent.env), the agent lists snapshots and decrypts one into a dump.rdb:
rowsafe-agent redis download-backup --stanza cache
rowsafe-agent redis download-backup --stanza cache --label 20261003-235013F --to ./dump.rdbPut it in an empty server's data folder (its dir, with appendonly no) and start it. Any server of the same version loads it. This restores a snapshot; restoring to a second in between needs Rowsafe.
Not yet
Not available for Redis and Valkey yet (the dashboard says so):
- Connection pooling.
- Migration previews (Redis has no schema).
Limits
- Not supported yet: Redis Cluster, Sentinel-managed servers, and servers reachable only over TLS or only through a Unix socket.
- Precision: restores to a second are precise to about a second (the moment each change reached the agent). Restores to a Mark are exact.
- When the agent is away longer than Redis's replication backlog holds (
repl-backlog-size, 1 MB by default), Redis sends a whole new snapshot when it returns. That becomes a new backup, but the gap can't be restored to a second. If it happens often, Pulse proposes a larger backlog. - Expired keys: keys past their expiry at restore time are gone, as Redis drops them.
- Every backup is a full snapshot, and Redis forks to make it.
- Servers Rowsafe can't follow (replication refused, or
min-replicas-to-write) get scheduled snapshots only, and restore only to those. See above. - Compare samples large databases; the result says how many keys were compared.
- Rewinding the whole server needs an empty logical database and free memory for one more copy of the largest one.
- Temporary servers (Proof, Rewind copies) need free disk and memory; the agent checks first and refuses if short.
- Fixes last only until the next restart when Redis can't write its config file; the result says so.
- Standby servers and clones need the agent on the server itself (not a Docker sidecar). Redis in Docker can still hold one, with the agent on the host (example). A standby starts with a full copy from the primary, not from the backup.
- After a switch to a standby, restores to any second start again from the new primary's first snapshot.
- Move in copies one standalone database (not Redis Cluster). Live sync needs a source that lets replicas connect over a plain connection; from managed providers it's a one-time copy with writes stopped.
- Safe copies and clones remove module-type keys (RedisJSON, search). They have none of the source's users.
- Find the moment groups writes by second and pattern; expired keys show as deleted.
- In Docker: restart the container yourself unless you add the container control service; update the agent by pulling the newest image of the same version. Redis updates and upgrades are a compose file change (Pulse shows the step), setting changes last until the container restarts, and logs need
--logfilein a volume the agent can read. - Restart, updates and upgrades need snapshots or the append-only file on, or the restart would empty the server (Pulse offers Turn on snapshots). Updates install from your server's package sources on Debian and Ubuntu.
- Protected mode can't be turned on from Rowsafe while clients connect over the network, or in Docker.
- Read and write users from Databases & users can't run
KEYSorSORT(Redis counts them as dangerous). Use the admin preset if an old app needs them. - Recommendations sample up to 10,000 keys per numbered database every 30 minutes, slowly. A pattern is sent only when it covers many sampled keys.
- Version checks go by version number: a fix your distribution backported (Debian, Ubuntu) isn't seen.