Redis is a popular key value store with extensive features including sharding, clustering, graph, time series and much more which has made it very popular with developers. It has many of the features you need to build a web app and scale it to large scale. In this article we will demonstrate how to install Redis on Debian Linux version 11. Let’s get started

NOTE: This demo is done on Debian 11 running on WSL (windows subsystem for linux). Slight variations may be needed on Debian 11 running on other cloud or virtualization platforms or natively on bare metal.

Update Debian 11 System First

Running the following commands in your terminal to make sure your system is ready for installation:

$ sudo apt update


$ sudo apt upgrade

Install Redis on Debian 11

Now install Redis Server package which will also include client packages

$ sudo apt-get install redis-server

Start Redis Server

You can now manually start a Redis daemon with redis-server command. Also you can verify it is started with ps command:

$ sudo redis-server /etc/redis/redis.conf


$ ps -ef | grep redis

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/05/echo/start-redis-1024×174.png" data-lazy- height="138" src="data:image/svg xml,” width=”810″>

Interact with Redis using the redis-cli

Test your redis instance locally using the redis-cli utility. Enter the interactive shell and insert a couple key values, print the key count and fetch a value from a key. Then delete everything with flushall. Here is the code:

Enter the redis-cli:

Insert a couple keys and then get the key count

127.0.0.1:6379> set f1 “apple”


127.0.0.1:6379> set f2 “banana”


127.0.0.1:6379> set f3 “orange”


127.0.0.1:6379> DBSIZE

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/05/echo/redis-keys.png" data-lazy- height="424" src="data:image/svg xml,” width=”957″>

Fetch the value of key “f3” and then delete all keys and verify key count:

127.0.0.1:6379> get f3 “apple”


127.0.0.1:6379> FLUSHALL


127.0.0.1:6379> DBSIZE

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/05/echo/redis-get-flush-1024×305.png" data-lazy- height="241" src="data:image/svg xml,” width=”810″>

Conclusion of Installation of Redis

Redis is installed now on Debian 11, using these sample steps. This is good enough for testing and developing with Redis. For production usage of Redis, best practices would be to ensure Redis daemon is supervised using the normal system init scripts. You can see options for this in the redis configuration file and check other tutorials on how to ensure Redis is auto-started and monitored in your system.

About the author

<img data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2022/05/echo/wolfman-150×150.jpg" height="112" src="data:image/svg xml,” width=”112″>

Linux Wolfman

Linux Wolfman is interested in Operating Systems, File Systems, Databases and Analytics and always watching for new technologies and trends. Reach me by tweeting to @linuxhint and ask for the Wolfman.