I am Hack Sparrow
Captain of the Internets.

Install Redis on Ubuntu and Mac

How to install Redis on Ubuntu and Mac OS X

Redis caught your interest and want to try it on your Mac or Ubuntu? Excellent! Installing Redis is almost similar in Mac and Ubuntu. wget does not come installed by default on Mac, so install wget first if you are on Mac.

And here we go:

$ wget http://redis.googlecode.com/files/redis-2.4.8.tar.gz
$ tar -zxvf redis-2.4.8.tar.gz
$ cd redis-2.4.8
$ make
$ make install
$ make test

If make install gives you "Permission denied" error, do sudo make install.The testing process takes a while to complete, so be patient.

To start the Redis server:

$ redis-server

When you start the server you will see this:

# Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'

You could run Redis without any customized configuration on your development machine, but will most probably need to use a customized config file in production. Use the redis.conf file which came with the installer as the template for your configuration file. While still in the installation dir, so this:

$ mkdir ~/.redis
$ mv redis.conf ~/.redis/

To start the server with the config file:

$ redis-server ~/.redis/redis.conf

To connect to the Redis server:

$ redis-cli

There you have installed Redis on your Ubuntu / Mac!

One Response to “Install Redis on Ubuntu and Mac”

  1. Justin Schier says:

    When running make test on Ubuntu 11.10, you may get an error saying:
    “You need ‘tclsh8.5’ in order to run the Redis test”

    Just install tcl8.5 like this:

    sudo apt-get install tcl8.5

Make a Comment