Redis is a well-known open-source data structure store that stores data in memory and is commonly used as a database. It is very popular among Linux users since it is quite easy to install it on any Linux-based system and use it. Today’s goal is also to learn how we can get the Redis server installed on our Ubuntu 20.04.
Installing Redis on Ubuntu 20.04
Redis can be installed and enabled on a Ubuntu system with the help of the following steps:
Step # 1: Start with a System Update:
We will start off with a Ubuntu system update with the command shown below:
$ sudo apt-get update
When our system is updated successfully, we can easily install Redis on it.
Step # 2: Install Redis on your System:
To install Redis on a Ubuntu system, the following command needs to be executed on it:
$ sudo apt install redis-server
When the Redis server will be installed on your system, you will see the output on your terminal similar to the one shown in the image below:
Step # 3: Enable the Redis Service:
However, the Redis service will not be enabled automatically after its installation. Hence, you will have to enable it manually with the following command:
$ sudo systemctl enable redis-server.service
If the enabling of the Redis service takes place successfully without any errors, then you will see a similar output like the one shown in the image below on your terminal:
Step # 4: Check the Status of the Redis Service:
Finally, you can also confirm the status of the Redis service by executing the following command:
$ sudo systemctl status redis-server.service
The “active (running)” status in the output shown in the image below indicates that the Redis service has been successfully enabled on our Ubuntu system.
Now, if you want to uninstall the Redis service from your system, then you can do this by running the following command:
$ sudo apt-get purge --autoremove redis-server
You can easily see that by following this tutorial, you will be able to install Redis on your Ubuntu 20.04 system within no time. Once this server is installed on your system, you can conveniently use it as a powerful database. Also, you can quickly remove the Redis server from your system without any hassle by running the one-liner command we stated at the end of this article.