Here we will install a single Redis instance running on one server. To get Redis, we will perform the following steps:
- First navigate your way out to the Redis IO download page: https://redis.io/download. Unless you are an advanced user of Redis, you will want the stable release (Redis 4.0.8 as of the time of writing).
- Download Redis, create a local directory, and move it there:
sudo mkdir /local sudo chown $USER:$USER /local cd /local mv ~/Downloads/redis-4.0.8.tar.gz .
- Now we can untar it, and it should create a directory and expand the files into it:
tar -zxvf redis-4.0.8.tar.gz
- Many people find it more convenient to rename this directory:
mv redis-4.0.8/ redis
- The browser interaction can be skipped entirely, by hitting redis.io download site for the latest, stable release with either wget or curl from the command line:
curl -O http://download.redis.io/redis-stable.tar.gz
- And for the purposes of this example, it will also be untarred and renamed to redis:
tar -zxvf redis-stable.tar.gz mv redis-stable/ redis
- At this point, all that has been downloaded is the source code:
sudo apt-get update
sudo apt-get install gcc make tcl build-essential
Be sure you have up-to-date versions of the gcc, make, tcl, and build-essential packages.
- Next, cd into the Redis directory, and build it:
cd redis
make
It's also a good idea to run make test.
If all of the tests passed, you should see a message similar to the following:
\o/ All tests passed without errors!
Depending on the version of Redis, it may need a specific version of tcl to successfully run the tests. If you see an error relating to a specific version of tcl, install it, and re-run make test.