Redis is an open-source, in-memory key-value data store used for caching, session management, message brokering, and real-time analytics. Starting with Fedora 41+, the Redis package has been replaced by Valkey – a fully compatible, community-driven fork maintained by the Linux Foundation. Valkey uses the same protocol, commands, and data structures as Redis, so existing applications work without changes.
This guide covers how to install and configure Valkey (Redis replacement) on Fedora 42. Fedora 42 ships Valkey 8.0.7 from the default repositories. We will cover installation, systemd service management, firewall rules, password authentication, persistence configuration, and basic CLI usage.
Prerequisites
- A server or workstation running Fedora 42
- Root or sudo access
- Port 6379/tcp open if remote clients need to connect
Step 1: Update the System
Update all packages to their latest versions before installing new software.
sudo dnf -y update
Step 2: Install Redis (Valkey) on Fedora 42
On Fedora 42, the valkey package provides the in-memory data store that replaces Redis. Install it from the default repos.
sudo dnf -y install valkey
This installs the Valkey server, CLI tool (valkey-cli), benchmark utility, and default configuration files. If you have scripts or applications that call redis-cli or redis-server by name, install the compatibility package as well.
sudo dnf -y install compat-redis
The compat-redis package creates symlinks so that redis-cli, redis-server, and redis.service all point to their Valkey equivalents.
Verify the installed version.
$ valkey-server --version
valkey server v=8.0.7 sha=00000000:0 malloc=jemalloc-5.3.0 bits=64 build=...
Step 3: Start and Enable the Valkey Service
Enable the service so it starts automatically on boot, and start it immediately.
sudo systemctl enable --now valkey
Check that the service is running.
$ systemctl status valkey
● valkey.service - Valkey data structure server
Loaded: loaded (/usr/lib/systemd/system/valkey.service; enabled; preset: disabled)
Active: active (running)
Main PID: 1234 (valkey-server)
Status: "Ready to accept connections"
Tasks: 5
Memory: 3.0M
CGroup: /system.slice/valkey.service
└─1234 "/usr/bin/valkey-server 127.0.0.1:6379"
Confirm it is listening on port 6379.
$ sudo ss -tlnp | grep 6379
LISTEN 0 128 127.0.0.1:6379 0.0.0.0:* users:(("valkey-server",pid=1234,fd=6))
Step 4: Configure Firewall for Redis on Fedora 42
If remote clients need to connect, open port 6379/tcp in firewalld.
sudo firewall-cmd --add-port=6379/tcp --permanent
sudo firewall-cmd --reload
Verify the rule is active.
sudo firewall-cmd --list-ports
Step 5: Configure Password Authentication
By default, Valkey accepts connections without authentication. For any environment beyond local development, set a strong password. Open the configuration file.
sudo vi /etc/valkey/valkey.conf
Find the requirepass directive (commented out by default) and set a strong password.
# requirepass foobared
requirepass YourStr0ngP@ssword
Restart the service to apply the change.
sudo systemctl restart valkey
Step 6: Configure Persistence
Valkey supports two persistence mechanisms – RDB snapshots (enabled by default) and Append-Only File (AOF) for more durable writes. To enable AOF persistence, edit the config file.
sudo vi /etc/valkey/valkey.conf
Set the following directives.
appendonly yes
appendfilename "appendonly.aof"
With AOF enabled, every write operation is logged to disk. This gives better durability than RDB snapshots alone – you lose at most one second of data on a crash (with the default appendfsync everysec setting). The AOF file is stored in /var/lib/valkey/.
Restart the service after changing persistence settings.
sudo systemctl restart valkey
Step 7: Allow Remote Connections (Optional)
By default, Valkey only listens on 127.0.0.1. To accept connections from remote hosts, update the bind directive in the configuration file.
sudo vi /etc/valkey/valkey.conf
Change the bind line to include your server’s IP address or use 0.0.0.0 to listen on all interfaces.
bind 0.0.0.0
Always set a password (Step 5) before binding to external interfaces. Restart the service to apply.
sudo systemctl restart valkey
Step 8: Basic Redis CLI Usage on Fedora
Connect to the Valkey instance using the CLI. If you installed the compat-redis package, redis-cli works as an alias.
valkey-cli
If password authentication is enabled, authenticate first.
127.0.0.1:6379> AUTH YourStr0ngP@ssword
OK
Test connectivity with PING.
127.0.0.1:6379> PING
PONG
Set and retrieve a key-value pair.
127.0.0.1:6379> SET mykey "Hello from Fedora 42"
OK
127.0.0.1:6379> GET mykey
"Hello from Fedora 42"
Check server information. If you have been managing Redis on Ubuntu or Debian, the commands are identical.
127.0.0.1:6379> INFO server
# Server
redis_version:8.0.7
redis_git_sha1:00000000
redis_git_dirty:0
server_name:valkey
os:Linux 6.14.x x86_64
tcp_port:6379
uptime_in_seconds:120
config_file:/etc/valkey/valkey.conf
Notice that the INFO output still shows redis_version for backward compatibility, while server_name identifies it as Valkey. This means monitoring tools like Prometheus with the Redis exporter continue to work without modification.
Work with other data structures – lists, hashes, and sets.
127.0.0.1:6379> LPUSH tasks "deploy-app" "run-tests" "build-image"
(integer) 3
127.0.0.1:6379> LRANGE tasks 0 -1
1) "build-image"
2) "run-tests"
3) "deploy-app"
127.0.0.1:6379> HSET server:web01 hostname "web01" ip "10.0.1.10" role "frontend"
(integer) 3
127.0.0.1:6379> HGETALL server:web01
1) "hostname"
2) "web01"
3) "ip"
4) "10.0.1.10"
5) "role"
6) "frontend"
Key Configuration Reference
| Setting | Default | Description |
|---|---|---|
bind | 127.0.0.1 -::1 | Network interfaces to listen on |
port | 6379 | TCP port for client connections |
requirepass | (disabled) | Password for client authentication |
appendonly | no | Enable AOF persistence |
maxmemory | (unlimited) | Maximum memory limit – set this in production |
maxmemory-policy | noeviction | Eviction policy when maxmemory is reached |
save | 3600 1 300 100 60 10000 | RDB snapshot intervals |
The full configuration file is at /etc/valkey/valkey.conf with detailed inline comments for every directive. For database workloads on Fedora, you may also want to look at MariaDB on Fedora or PostgreSQL on Fedora depending on your data model requirements.
Conclusion
Valkey 8.0.7 is installed and running on Fedora 42 as a drop-in Redis replacement. The server is configured with password authentication, AOF persistence, and firewall rules for remote access. For production deployments, set the maxmemory directive to prevent unbounded memory usage, configure TLS encryption for data in transit, and set up replication for high availability.