How to Install Redis on Windows 10 / 11 (Step by Step Tutorial). In this post, we introduce Redis, its features, benefits then move on the Redis installation on Windows 10 / 11.
So, let’s start with how to Install Redis on Windows 10 / 11 (Step by Step Tutorial).
Redis is an open source, in memory data structure store, database, cache, message broker, and streaming engine. Basically, it provides data structures like strings, lists, hashes, sorted sets and streams. Also, it comprises built in replication, transactions, LRU evictions, Lua Scripting, and different levels of on disks persistency.
In these types, you can run atomic operations, like appending a string, pushing an element to a list, union, and difference, Value incrementation in a hash, or getting the highest ranking members in a sorted set.
Since Redis works with an in memory database, it enables you to achieve top performance. Moreover, based on your use cases, it can persist your data periodically by dumping the dataset to disk or appending each command to a disk based log.
Besides, Redis also supports asynchronous replication with the help of fast, non blocking synchronization and auto reconnection with partial resynchronization on net split.
Simply put, Redis provides the following features:
Transactions – With the help of Redis transaction, you can execute a group of commands centered around MULTI, EXEC, DISCARD, and WATCH orders in a single step.
Pub/Sub – Subscribe, Unsubscribe, and publish implementation of Publish/ subscription to send their information to the recipient (Subscribed). Instead, when the message shows that channel unintentionally, (if applicable) subscribers, maybe there. Subscribers indicate their interest in one or more channels and receive only the information they have an interest in without knowing the editors (if any). Decommissioning publishers and subscribers allows for greater scalability and dynamic network topology.
Lua Scripting – The first argument is the script source code. Scripts are written in Lua and run by the Lua 5.1 compiler with Redis.
KeyEviction – When using Redis as a cache, allowing old data to be automatically deleted when new data added is convenient. This behaviour is well known in the developer community, as it is the default behaviour of the popular Memcached system.
High Availablity with Redis Sentinel – Redis Sentinel provides high availability for Redis when they do not use Redis Cluster. Basically, Redis Sentinel also provides other side activities such as monitoring, notifications, and acts as a configuration provider for clients.
Certainly, Redis is designed to work with server operating system like, Linux, OS X and BSD and is not compatible with Windows systems. So if you want to install Redis on Windows 10 / 11 then you will need to install Ubuntu operating system on your Windows 10 / 11 system.
As I noted, Windows allows you to easily install Ubuntu operating system from the Microsoft store.
Enable Windows Subsystem for Linux
Before starting, you will need to enable the Windows subsystem for Linux on your Windows 10 / 11. Follow the below steps to enable the Windows Subsystem for Linux:
Step 1 – Open the Windows Control Panel as shown below:
Step 2 – Click on the Programs. You should see the following screen:
Step 3 – Click on the “Turn Windows features on or off”. You should see the following screen:
Step 4 – Locate and enable the “Windows subsystem for Linux” then click on the OK button to install this feature. Once the installation is finished, you should see the following screen:
Step 5 – Click on the Restart now button to restart your Windows system.
Next step, after enabling Window Subsystem Linux, follow the below steps to install Ubuntu 20.04 via Microsoft store:
Step 1 – Search and open the “Microsoft Store”. Once the Store is open, go to the search bar, type “Ubuntu”. You should see different Ubuntu apps in the following screen:
Step 2 – Select the Ubuntu 20.04. You should see the following screen:
Step 3 – Click on the Get button to download the Ubuntu 20.04. Once the Ubuntu 20.04 is downloaded, you should see the following screen:
Step 4 – Click on the Launch button to start and open a new terminal windows and shows that Ubuntu 20.04 is being installed, and we need to hold on for a while.
Step 5 – After completed the installation, you will be asked to set a username and password for Ubuntu as shown below:
Together, Redis comes with a redis-cli command-line utility that allows you to connect and manage Redis instance via command line. Run the following command to connect to the Redis server instance:
redis-cli
Once you are connected, you will get the following shell:
127.0.0.1:6379>
Now, ping the Redis service using the following command:
127.0.0.1:6379> ping
If everything is fine, you will get the following output:
PONG
After that, please run the following command to exit from the Redis instance:
By default, Redis can be connected only from the local system. So if you want to connect the Redis server from remote machine then you will need to allow the remote connection via Redis configuration file.
Edit the Redis main configuration file using the following command:
nano /etc/redis/redis.conf
Find the following line:
#bind 127.0.0.1 ::1
And, replaced it with the following line:
bind your-server-ip
Save and close the file then reload the Redis service to apply the changes:
How to Install Redis on Windows 10 / 11 (Step by Step Tutorial) Conclusion
In this post, we explained how to install Redis on Windows 10 / 11. We also explained how to enable Windows subsystem for Linux and run Redis on Ubuntu instance. Redis is very popular, fast, flexible in memory database with lots of great data structures. Thanks to those features you have one of the most versatile NoSQL databases.
Take a look at more Redis content in our blog here.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.