Install Redis Server on Ubuntu

A. apt-get install old version

You can easily install Redis 2.8 on Debian by this command:

sudo apt-get install redis-server

B. build latest version

To install the latest version, you need to build it by yourself.

sudo apt-get update
sudo apt-get install build-essential
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make test
make
sudo apt-get install tcl8.5
sudo make install

Installation complete. Now configure it.

cd utils
sudo ./install_server.sh

All done. Let’s check the version by this command.

redis-server --version

It will print info like following text.

Redis server v=3.2.0 sha=00000000:0 malloc=jemalloc-4.0.3 bits=32 build=96e283a03034e952

You can also run “redis-cli” and use “info” command to get more detail.

To control the service, use this command. (The port number depends on your own configuration)

sudo service redis_6379 [start | stop | restart]

Allow remote access

Before using remote redis server access, modify your conf file first.

#Allow all
bind 0.0.0.0

#Allow only one IP
#bind 192.168.1.11

标签: none

评论已关闭