http://grainier.net/how-to-install-redis-in-ubuntu/
http://vvv.tobiassjosten.net/linux/installing-redis-on-ubuntu-with-apt/
https://scaleyourcode.com/blog/article/3
http://iluoxuan.iteye.com/blog/1938277
http://www.cnblogs.com/viaivi/archive/2011/12/08/2281319.html
http://blog.fens.me/linux-redis-install/
http://redis.io/topics/quickstart
What is Redis?
Redis is a flexible, open-source, key value data store. Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database. Additionally, it has also been compared to memcache and can be used, with its basic elements as a cache with persistence.
Set-up Environment For Installation.
Before installing redis, there are a couple of prerequisites that need to be downloaded in-order to proceed with the installation.
1. Update all of the apt-get packages.
sudo apt-get update
1 | sudo apt-get update |
2. Download a compiler with build essential in-order to install Redis from source.
sudo apt-get install build-essential
1 | sudo apt-get install build-essential |
3. Download and install tcl8.5
sudo apt-get install tcl8.5
1 | sudo apt-get install tcl8.5 |
Install Redis
After all of the prerequisites and dependencies downloaded to the server, you can proceed with the Redis installation from source.
1. Download the Stable Redis release from their website. google code. The latest stable version is 2.8.3
wget http://download.redis.io/releases/redis-2.8.3.tar.gz
1 | wget http://download.redis.io/releases/redis-2.8.3.tar.gz |
2. Extract the downloaded .tar file, and switch into that directory.
tar -xvzf redis-2.8.3.tar.gz && cd redis-2.8.3
1 | tar -xvzf redis-2.8.3.tar.gz && cd redis-2.8.3 |
3. Proceed to with the make command.
make
1 | make |
4. Run the recommendedmake test .
make test
1 | make test |
5. Do themake install , which installs the program system-wide.
sudo make install
1 | sudo make install |
6. Once the program has been installed, Redis comes with a built in script that sets up Redis to run as a background daemon. To access the script move into the utils directory.
cd utils
1 | cd utils |
7. From there, run the Ubuntu/Debian install script.
sudo ./install_server.sh
1 | sudo ./install_server.sh |
8. As the script runs, you can choose the default options by pressing enter. Once the script completes, the redis-server will be running in the background. You can start and stop redis with these commands (the number depends on the port you set during the installation. 6379 is the default port setting).
sudo service redis_6379 start sudo service redis_6379 stop
1 2 | sudo service redis_6379 start sudo service redis_6379 stop |
9. You can then access the Redis database by typing the following command.
redis-cli
1 | redis-cli |
If you have more-than one Redis instances, use below command. (Where 6379 is the port number. This will change from instance to instance)
redis-cli -p 6379
1 | redis-cli -p 6379 |
10. You now have Redis installed and running. The prompt will look like this.
redis 127.0.0.1:6379>
1 | redis 127.0.0.1:6379> |
11. Finally, Use below command to set Redis to automatically start at boot.
sudo update-rc.d redis_6379 defaults
1 | sudo update-rc.d redis_6379 defaults |
That’s it. Now you have Redis server installed on your Ubuntu machine / server.
Because of any reason if you need to Un-install Redis server from your Server, refer to my article on How to uninstall Redis server from Ubuntu
If you find this useful, Please leave a comment below.