Redis is a key-value data storage solution, often referred as to a “NoSQL” database. It can achieve very high read/write speeds because it is an in-memory but persistent on-disk database. In this guide, you will learn how to install Redis on Ubuntu.
Getting started
- Update the apt-get packages:
sudo apt-get update
- Download a compiler which will help us install Redis:
sudo apt-get install build-essential
Installing Redis
- Download the latest stable release of Redis:
wget http://download.redis.io/releases/redis-stable.tar.gz
- Untar it:
tar xzf redis-stable.tar.gz
- Go into the directory:
cd redis-stable
- Run the “make” command:
make
- Run the recommended test:
make test
- Finally, finish by making the install:
make install
Post install procedure
Redis comes with a script that enables it to run in the background.
- Navigate into the “utils” folder:
cd utils
- Run the script:
sudo ./install_server.sh
When the script is launched, it prompts you to choose running options. For the default, just press the enter key. Once the script finishes, the Redis server will be running in the background.
Conclusion
Congratulations! You have successfully setup a working Redis server instance.
Here are some useful commands:
-
Start the Redis server:
sudo service redis_6379 start
6379 is the port and will depend on your port option during install.
-
Stop the Redis server:
sudo service redis_6379 stop
6379 is the port and will depend on your port option during install.
-
Access the Redis CLI:
redis-cli
Want to contribute?
You could earn up to $300 by adding new articles
Suggest an update
Request an article