Redis

How to Install Redis Database on Ubuntu 22.04 & Linux Mint

Redis (Remote Dictionary Server) is an open-source key-value data store that allows users to use this database as a cache on top of other databases to improve the performance of the applications. It serves as server-client architecture, which means that it can run as a service in the background so that the client can query it. It has two columns, one for the key and the other for the value. In terms of performance, it runs better than other databases such as MySQL, MariaDB or PostgreSQL.

This article presents a detailed guide to install Redis Database on Ubuntu 22.04 and Linux Mint.

How to install Redis Database on Ubuntu 22.04 & Linux Mint

The installation of Redis Database on Ubuntu 22.04 and Linux Mint is pretty straightforward and doesn’t require installing additional dependencies or packages on the system. Use the below-mentioned steps to install Redis successfully on your system.

Step 1: Update Ubuntu or Linux Mint packages

First, ensure that your system’s packages are up to date, which can be done from the following command:

$ sudo apt update -y

If your packages need upgradation, run the following command to upgrade them:

$ sudo apt upgrade -y

Step 2: Install Redis Database

After updating the packages, install Redis database on your system through the following command:

$ sudo apt install redis-server -y

Step 3: Start Redis Service

Once the Redis installation is completed, issue the following command to start its service:

$ sudo systemctl start redis.service

You can enable or restart Redis service any time by replacing the “start” from the above command with “enable” or “restart”.

To check the running status of Redis service, issue the below-given command:

$ sudo systemctl status redis.service

The above output confirms that Redis service is up and running on your system.

Testing Redis Functionality

To test whether the Redis database functionality is working correctly, you will need to execute the following command:

$ redis-cli

Then test the connectivity through the “ping” command.

The above output ensures that the server is still alive.

Now, for testing use the following statement:

set test “It’s working!”

With the output confirms OK, you can retrieve the value through following statement:

get test

Use the “quit” statement to finish the test process.

Remove Redis Database from Ubuntu 22.04 and Linux Mint

If you no longer want to use Redis service on your system, you can execute the following command to completely remove it.

$ sudo apt remove --autoremove redis-server -y

Conclusion

Redis database is a robust in-memory database that can easily be used as a cache on top of other databases to enhance the performance of the applications. Its installation is pretty simple on Ubuntu 22.04 and Linux Mint, which requires a single installation command. After that, you can easily use this database to execute various tasks faster than using MySQL or MariaDB.

About the author

Talha Saif Malik

Talha is a contributor at Linux Hint with a vision to bring value and do useful things for the world. He loves to read, write and speak about Linux, Data, Computers and Technology.