How To Install Redis on Debian 12

Redis is a remote dictionary server that uses the in-memory storage system which, unlike traditional relational databases, uses RAM for data retrieval and storage. You should install it if you need fast data access, multiple data structures, and real-time messaging on Debian. Redis comes with two licenses one is Source Available License v2 and the other is Server Side Public License v1, if you are a beginner then start with the free version which is the Source Available License. To install Redis on Debian, read this guide as it will explain multiple ways of installation.

4 Ways To Install Redis on Debian

Redis is used in high-traffic websites, e-commerce platforms, real-time chat, and social media applications. Further, it is also used by mobile app and web developers, to install Redis on Debian, there are primarily four ways which this guide will discuss:

1: Through Redis Official Repository

The first method to install Redis on Debian is using Redis official repository, this method is suitable if you are looking for the latest version of Redis. To install Redis on Debian via its repository, add its GPG key first for package validation:

curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg

Adding GPG key on Debian for Redis repository.

Next, add the Redis repository on Debian in its sources directory signed by the GPG key added previously:

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list

Adding Redis repository in Debian

Now update the apt packages list so that Redis repository is added successfully:

sudo apt-get update

Updating apt packages list on Debian after adding Redis repository

Now use the apt package manager to install Redis on Debian by running the following g command:

sudo apt-get install redis

Installing Redis on Debian via Redis official repository

Before launching or using Redis on Debian you need to do some configurations which will be discussed in the later section. Since the apt package manager installs the command line version, so execute the below command to launch Redis on Debian:

redis-cli

Launching Redis on Debian 12 installed via Redis repository

2: Through Snap App Installer

The next method to install Redis on Debian is using a third-party package installer named Snap, to install Redis via Snap execute the below command:

sudo snap install redis

Installing Redis on Debian 12 using Snap Package manager

Now to confirm the Redis installation on Debian via Snap list all the Snap-installed apps:

sudo snap list

Listing Snap-installed apps on Debian to verify Redis installation via Snap

To launch Redis on Debian installed via Snap you need to start the Redis service, so to start the Redis service execute:

sudo snap start redis

Starting Redis service on Debian using Snap package manager.

Next, verify if the Redis service is active or not by executing the below command:

sudo snap services

Listing Snap services on Debian to verify if Redis service is active or not

Now launch Redis on Debian by using the snap run command:

sudo snap run redis.cli

Launching Redis on Debian installed via Snap package manager

Redis also comes with a sort of GUI version named RedisInsight, it allows users to optimize and visualize their databases with the help of its user-friendly interface. So if you are more inclined towards using Redis GUI version then execute the below command:

sudo snap install redisinsight

Installing Redisinsight on Debian using Snap package manager Redis (GUI)

Further to launch Redis GUI installed via Snap execute the below command:

redisinsight

Launching RedisInsight on Debian 12 installed via Snap package manager.

3: Through Flatpak App Installer

Another way to install Redis GUI version on Debian is by using the Flathub repository which is used by the Fatpak app installer. To install RedisInsight on Debian via Flatpak execute:

flatpak install flathub com.redis.RedisInsight

Installing RedisInsight on Debian using Flatpak package manager.

For RedisInsight you do not need to do any configurations from the command line as you can set everything from within the application to launch it execute:

flatpak run com.redis.RedisInsight

Launching RedisInsight on Debian 12 installed via Flatpak package manager.

4: Through Debian Default Repository

The default Debian package manager comes with Redis server repository but the version will be older. However, to install Redis via apt package manager execute:

sudo apt install redis-server

Installing redis on Debian using apt package manager.

After carrying out the necessary configuration steps for Redis execute the below command to launch it:

redis-cli

Launching Redis on Debian installed via apt package manager.

How To Configure Redis On Debian 12

The first thing you need to do after installing Redis on Debian, either via its official repository or the Debian default repository, is to change the supervised setting to systemd in its configuration file:

sudo nano /etc/redis/redis.conf

This is because Debian uses the systemd init system so changing it to systemd will declare the init system for managing Redis as a service, thus allowing the user more control:

Once you are done with the changes then save the file and close it, after that reload the systemd daemon to apply the changes by executing:

sudo systemctl daemon-reload

Another thing that you need to remember is whether you are using the apt package manager or Redis repository to install Redis do not use the below command as some blogs have mentioned it:

sudo systemctl status redis

 

redis.service not found error on Debian

To check the status of the Redis service on Debian use the following command:

sudo systemctl status redis-server

Here in the below image, you can see that Redis service is active but not enabled:

Checking redis-server status on Debian using systemctl utility.

So to enable the Redis service on Debian execute:

sudo systemctl enable redis-server

Enabling Redis-server service on Debian using systemcytl utility

Note: I have also tried installing Redis using its source file on Debian but while installing the make file I encountered various unsolvable errors so try avoiding that method.

Redis comes with different versions and these include Redis Enterprise software,Redis Community Edition & Stack, and Redis Insight so here in the table below I have compared all these, which will help you in choosing which one is best for you:

 

Features  Redis Community Edition (Open Source)Redis Stack Redis Enterprise Software
Basic caching Available AvailableAvailable
Support optionsLimitedVariesEnterprise-grade support
Object mapping librariesAvailableAvailableAvailable
Advanced features Not Available Available (Querying, indexing, etc.)Available (Geo-distributed Redis)
Disaster recoveryNot AvailableNot Available Available
Automated deploymentNot AvailableNot Available Available ((On-premise, cloud, K8s)
In-memory capacity extensionNot AvailableNot Available Available (SSD)
High availabilityNot AvailableNot Available Available
Data modelsFlexibleFlexibleJSON Support
Scalability Smaller-scaleExtends Redis capabilitiesEnterprise-scale operations
CostFreeVaries (based on features)Contact Redis Labs for pricing

 

Conclusion

To install Redis on Debian there are primarily four ways, these include using Redis’s official repository, the Snap app installer, Flatpak package manager, and using Debian default repository (apt). If you are more interested in the Redis GUI version then either use Snap or Flatpak, otherwise use the Redis official repository method.

 

Index
Scroll to Top