Step by step Redis Installation on Ubuntu

Step by step Redis Installation on Ubuntu 1

What is Redis:

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries. The name Redis means REmote DIctionary Server.

Redis supports many languages like ActionScript, C, C++, C#, Chicken Scheme, Clojure, Common Lisp, D, Dart, Erlang, Go, Haskell, Haxe, Io, Java, JavaScript (Node.js), Julia, Lua, Objective-C, OCaml, Perl, PHP, Pure Data, Python, R,  Racket, Ruby, Rust, Scala, Smalltalk and Tcl.

Prerequisite

  • Update apt-get packages

apt get update

  • Install compiler to build some packages like GCC, make etc.

Build essential

  • Tool Command Language (TCL) is required to run Redis

TCL8.5

 

Installation

  • Now we can download Redis from redis.io and un-package it.

$ wget http://download.redis.io/releases/redis-stable.tar.gz

Redis download
$ tar xzf redis-stable.tar.gz

  • We can run make and make test command to compile and test the package. ‘make’ command will end as below screen.

Make

  • ‘make test ’ command will run some tests on the package. In my package 46 test case were there. After all the test successfully completed it will appear as below screen.

Make test

  • Once test is completed, We can run ‘make install’ to finalize the process.

sudo make install

  • Install the redis server using below script

cd utils

sudo ./install_server.sh

  • Now, Redis server is ready to use.
  • In the above screenshot, we can see that Redis service is registered as ‘redis_6379’. Here, 6379 is port, where Redis runs.
  • Use the below command to start, stop or restart the redis server.

sudo service redis_6379 start

sudo service redis_6379 stop

sudo service redis_6379 restart

  • If, you want to use Redis database, Run

redis-cli

Redis DB

  • Now Redis server is running and functioning. Cheers!