Create Redis database from Source

Step 1: Download, extract and compile Redis#

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make

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
OK
redis> get foo
"bar"

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

Next Step#