Redis package is supported natively for Ubuntu distribution, so if you want to install Redis, just get straight to it.
$ sudo apt-get update
$ sudo apt-get install redis-server
After installation, you might want to change binding IP addresses or port number, which can be done by editing file /etc/redis/redis.conf
port 6379
bind 127.0.0.1 192.168.0.2
Change to appropriate value that you want and restart redis server,
$ sudo systemctl restart redis-server.service
To test Redis connection, issue following command:
$ redis-cli -h IP_ADDRESS ping
PONG
If you get reply as PONG
, that means Redis server is running properly.