Install redis on ubuntu

In this article we will be going to see how to install redis on ubuntu. Redis is an open source in memory based database. It is a data structure store, and is used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs and geospatial indexes with radius queries.

Let’s see the installation steps for Redis. Run below set of commands to install redis.


mkdir redis && cd redis
curl -O http://download.redis.io/redis-stable.tar.gz
tar xzvf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install

To start redis server, run below command.


redis-server

To test if redis is installed and running, run below command.


redis-cli ping

If you get PONG as response that means it is installed and running

If you want to set some value in redis, run below commands.


redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
Please follow and like us:
20

Add a Comment

Your email address will not be published. Required fields are marked *