How To Install Redis in Ubuntu

What is Redis?

Redis is a flexible, open-source, key value data store. Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database. Additionally, it has also been compared to memcache and can be used, with its basic elements as a cache with persistence.

Set-up Environment For Installation.

Before installing redis, there are a couple of prerequisites that need to be downloaded in-order to proceed with the installation.

1. Update all of the apt-get packages.

2. Download a compiler with build essential in-order to install Redis from source.

 3. Download and install tcl8.5

Install Redis

After all of the prerequisites and dependencies downloaded to the server, you can proceed with the Redis installation from source.

1. Download the Stable Redis release from their website. google code. The latest stable version is 2.8.3

2. Extract the downloaded .tar file, and switch into that directory.

3. Proceed to with the  make  command.

4. Run the recommended make test .

5. Do the make install , which installs the program system-wide.

6. Once the program has been installed, Redis 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.

7. From there, run the Ubuntu/Debian install script.

8. As 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).

9. You can then access the Redis database by typing the following command.

If you have more-than one Redis instances, use below command. (Where 6379 is the port number. This will change from instance to instance)

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

11. Finally, Use below command to set Redis to automatically start at boot.

That’s it. Now you have Redis server installed on your Ubuntu machine / server.

Because of any reason if you need to Un-install Redis server from your Server, refer to my article on How to uninstall Redis server from Ubuntu

If you find this useful, Please leave a comment below.