How to install Redis on Ubuntu-14.04

redisRedis is a data structure server. It is open-source, networked, in-memory, and stores keys with optional durability. Redis may be considered a participant in the “NoSQL” movement and is an attractive tool for developers of some kinds of applications. Redis is written in ANSI C and runs on POSIX systems such as Linux, Mac OS X and Solaris. It can be accessed by applications through its client API library. This article will explain you how to install and use redis.

System Preparation:

Before install the redis, we need to full the prerequisites of redis that will make easy for install it.

Start off by updating all of the apt-get packages:

sudo apt-get update

Update the ubuntu systemNow, we need download a compiler with build essential which will help us install Redis from source:

sudo apt-get

install build-essential for redisLastly, we need to download tcl8.5

sudo apt-get install tcl8.5

Install download tcl for redis

Install Redis

Now, we have done all the prerequisite and dependencies on the server. Now we can ready for install the redis from source code.

Now, you can download the latest stable redis version 2.8.9 tarball from google code.

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

 Download the redis application on the serverDownloaded applicationExtract the downloaded .tar file, and switch into that directory.

tar xzf redis-2.8.9.tar.gz
cd redis-2.8.9

How to install redis on Ubuntu - 14.04How to install redis on Ubuntu- 14.04How to install redis on Ubuntu- 14.04Now, you can Proceed to with the make command

make

How to install redis on Ubuntu- 14.04Now, You need to Run the recommended make test

make test

How to install redis on Ubuntu- 14.04Now, Finish up by running make install, which installs the program system-wide.

sudo make install

How to install redis on Ubuntu- 14.04Redis program has been installed; It comes with a built in script that sets up Redis to run as a background daemon. To access the script move into the utils directory.

cd utils

How to install redis on Ubuntu- 14.04How to install redis on Ubuntu- 14.04From there, run the Ubuntu/Debian install script:

sudo ./install_server.sh

Once the script runs, you can choose the default options by pressing enter. Once the script completes, the redis-server will be running in the background.

You can start and stop redis with these commands (the number depends on the port you set during the installation. 6379 is the default port setting):

How to install redis on Ubuntu- 14.04

sudo service redis_6379 start
sudo service redis_6379 stop

How to install redis on Ubuntu- 14.04 How to install redis on Ubuntu- 14.04Now, you can then access the redis database by typing the following command:

redis-cli

You now have Redis installed and running. The prompt will look like this:

redis 127.0.0.1:6379>

How to install redis on Ubuntu- 14.04Now, To set Redis to automatically start at boot, run:

sudo update-rc.d redis_6379 defaults

Enjoy 🙂

Tagged , , , . Bookmark the permalink.