Based on this article
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install redis-server
sudo systemctl enable redis-server.service
Update Redis configuration file redis.conf
sudo nano /etc/redis/redis.conf
and set this values
maxmemory 256mb
maxmemory-policy allkeys-lru
and restart the service
sudo systemctl restart redis-server.service