Way One:
Download address: http://redis.io/download, download the latest version of the document.
The latest version of the document used in this tutorial is 2.8.17, download and install:
$ wget http://download.redis.io/releases/redis-2.8.17.tar.gz
$ tar xzf redis-2.8.17.tar.gz
$ cd redis-2.8.17
$ make
After make the redis-2.8.17 directory will appear after the compiled Redis service program Redis-server, as well as the client program for testing REDIS-CLI, two programs located in the installation directory SRC directory:
Start the Redis service below.
$ cd src
$./redis-server
Note this way of starting Redis is using the default configuration. You can also tell Redis to start with the following command using the specified configuration file through the startup parameters.
$ cd src
$./redis-server redis.conf
Redis.conf is a default configuration file. We can use our own configuration files as needed.
Once the Redis service process is started, you can use the test client program REDIS-CLI to interact with the Redis service. Like what:
$ cd src
$./redis-cli
redis> set foo bar
ok
redis> get foo
"Bar"
Way Two:
In Ubuntu system installation Redi can use the following command:
$sudo apt-get Update
$sudo apt-get install Redis-server
Start Redis
$ redis-server
See if Redis is started.
$ redis-cli
The above command will open the following terminal:
Redis 127.0.0.1:6379>
127.0.0.1 is the native IP, and 6379 is the Redis service port. Now let's enter the PING command.
Redis 127.0.0.1:6379> Ping
PONG
The above indicates that we have successfully installed Redis.