How To Install Redis on Ubuntu 16.04 LTS

r00t April 7, 2017

Install Redis on CentOS 7

In this tutorial we will show you how to install and configuration Redis on Ubuntu 16.04. For those of you who didn’t know, Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets. Redis also supports datatypes such as Transitions, Publish and Subscribe. ‘Redis ’ is considered more powerful than ‘Memcache’ . It would be smart to bring ‘Redis’ into practice and put ‘Memcache’ down for a while.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Redis on a Ubuntu 16.04 LTS (Xenial Xerus) server.

Install Redis on Ubuntu 16.04 LTS

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Redis.

Installing Redis on an Ubuntu is simple. Run the command below to install Redis on your machine:

Redis provide php extension to work with php. Here we will cover installation of Redis Extension of php from source compilation and using apt repository. Following command will install and setup redis extension with php:

Step 3. Configure Redis Cache on Ubuntu 16.04.

To configure Redis as a cache you need to edit the /etc/redis/redis.conf file:

To configure the max memory for Redis as well as how Redis will select what to remove when the max memory is reached, add the following lines at the end of the file:

Save and close the file, then restart the Redis service:

Step 4. Starting and Testing the Redis.

We will start and check the status of the Redis with the below commands:

We will now test the Redis instance with some commands:

Congratulation’s! You have successfully installed Redis. Thanks for using this tutorial for installing Redis on your Ubuntu 16.04 system. For additional help or useful information, we recommend you to check the official Redis web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!


Share on Google+0Share on Facebook0Tweet about this on TwitterShare on Tumblr0Share on StumbleUpon1Share on Reddit1Pin on Pinterest100
The Tags:

Leave a Comment