How To Install and Configure Redis

sudo apt-get update

sudo apt-get install build-essential tcl

apt-get install build-essential tcl

curl -O http://download.redis.io/redis-stable.tar.gz

tar xzvf redis-stable.tar.gz

cd redis-stable

make

make test

make install

mkdir /etc/redis

cp  redis.conf /etc/redis

supervised systemd

dir /var/lib/redis

vi  /etc/systemd/system/redis.service

[Unit]
 Description=Redis In-Memory Data Store
 After=network.target

[Service]
 User=redis
 Group=redis
 ExecStart=/usr/local/bin/redis-server /etc/redis/redis.conf
 ExecStop=/usr/local/bin/redis-cli shutdown
 Restart=always

[Install]
 WantedBy=multi-user.target

adduser --system --group --no-create-home redis

mkdir /var/lib/redis

chown redis:redis /var/lib/redis

chmod 770 /var/lib/redis

systemctl start redis

systemctl status redis

redis-cli

ping

get test

set test "It's working!"

exit

systemctl restart redis

systemctl enable redis