Install Redis

sudo apt install redis-server
sudo systemctl enable redis-server

Configuration

sudo nano /etc/redis/redis.conf
# Set maxmemory
maxmemory 256mb
maxmemory-policy allkeys-lru
# Bind to localhost
bind 127.0.0.1
# Set password
requirepass your_password

Test

redis-cli
AUTH your_password
SET test 'hello'
GET test