Redis: Installation

Petr Kostelanský | 25 October 2017
Let's look at how install Redis on Linux system especially on Ubuntu

The main distribution of Redis is for Linux so we will use Ubuntu to install Redis. Redis is also available for Windows but isn't officially supported Learn more

Installation on Ubuntu

If you are installing Redis on remote machine you can use Putty or Bitvise ssh client to connect to Linux.

Info: sudo mean run command with admin privileges

Update packages repository

sudo apt-get update

Install compiler to help us install Redis from source

sudo apt-get install build-essential

To test Redis installation we need tcl

sudo apt-get install tcl

Jump into the temp folder (wget download files into current directory)

cd /tmp

Download Redis tar with specific version. You can download and install it via Ubuntu packaes but there is older version.

Download tar file into current directory

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

Unzip tar file
z means (un)zip,
x means extract files from the archive,
v means print the filenames verbosely,
f means the following argument is a filename

tar xzf redis-3.2.10.tar.gz

Jump into folder

cd redis-3.2.10

Build Redis from source code

make

Run Redis tests

make test

Copy files (program, libraries, documentation) to their final final destination

sudo make install

Create config directory

sudo mkdir /etc/redis

Copy Redis sample config file

sudo cp /tmp/redis-3.2.10/redis.conf /etc/redis

Now we have installed Redis. By default Redis is running under 6379 port but it's possible to change it in /etc/redis/redis.conf

It's also good practice to rename redis.conf to redis-(port).conf because we are going to run more Redis instance on one machine and each instance need to have own redis.conf configuration file.

Rename redis.conf to redis-6379.conf.

mv /etc/redis/redis.conf /etc/redis/redis-6379.conf
Loading ads...