Redis is an in-memory data structure store used as a cache, message broker, and database. Redis 8 introduces improved memory efficiency, better persistence options, and enhanced cluster management. This guide installs and secures Redis 8 on Ubuntu 26.04 LTS.
Tested and valid on:
- Ubuntu 26.04 LTS
Prerequisites
- Ubuntu 26.04 LTS server
- A user with sudo privileges
Step 1 – Install Redis
sudo apt update
sudo apt install redis-server -y
Step 2 – Configure Redis
Edit the Redis config to use systemd supervision and set a password:
sudo nano /etc/redis/redis.conf
Set:
supervised systemd
requirepass YourStrongRedisPass2026!
Step 3 – Start and Enable Redis
sudo systemctl restart redis-server
sudo systemctl enable redis-server
sudo systemctl status redis-server
Step 4 – Test Redis Connection
redis-cli
AUTH YourStrongRedisPass2026!
PING
SET testkey 'Hello Redis 8'
GET testkey
exit
Step 5 – Bind to Localhost Only
Confirm Redis only listens on localhost (default, but verify):
grep '^bind' /etc/redis/redis.conf
Step 6 – Tune Memory Usage
Set a maximum memory limit and eviction policy:
sudo nano /etc/redis/redis.conf
Add:
maxmemory 256mb
maxmemory-policy allkeys-lru
sudo systemctl restart redis-server
Step 7 – Allow Remote Access (optional)
Only do this on a private network. Edit bind address and open UFW:
bind 0.0.0.0
sudo ufw allow 6379/tcp
Conclusion
Redis 8 is installed and secured on Ubuntu 26.04 LTS. Use it as a session cache for PHP/Laravel applications, a Celery broker for Python, or a pub/sub messaging layer — Redis dramatically speeds up data-intensive workloads.