Create Redis database from Source

Step 1: Download, extract and compile Redis#

tar xvzf redis-stable.tar.gz
cd redis-stable

It is a good idea to copy both the Redis server and the command line interface into the proper places, either manually using the following commands:

sudo cp src/redis-server /usr/local/bin/
sudo cp src/redis-cli /usr/local/bin/

Or just using sudo make install.

The binaries that are now compiled are available in the src directory.

Step 2: Running Redis Server#

$ redis-server

Step 3: Interacting with Redis Client#

$ src/redis-cli
redis> set foo bar
redis> get foo

Please note: By default, Redis has 0-15 indexes for databases, you can change that number databases NUMBER in redis.conf.

Next Step#