Redis, developed in 2009, is a flexible, open-source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker. Following in the footsteps of other NoSQL databases, such as Cassandra, CouchDB, and MongoDB, Redis allows the user to store vast amounts of data without the limits of a relational database.
It supports various data structures such as strings, hashes, sets, lists, sorted sets, bitmaps, hyperlog logs and geospatial indexes with radius queries.
Redis stands for REmote DIctionary Server.
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.
To install Redis on Windows, you’ll first need to enable WSL2 (Windows Subsystem for Linux). WSL2 lets you run Linux binaries natively on Windows. For this method to work, you’ll need to be running Windows 10 version 2004 and higher or Windows 11.
HOW TO INSTALL LINUX ON WINDOWS WITH WSL
- Open PowerShell or Windows Command Prompt in administrator mode by right-clicking and selecting “Run as administrator”, enter the wsl –install command, then restart your machine.
2. After executing the above instruction, it will show you a list of Linux distributions available.
To change the distribution installed, enter: wsl --install -d <Distribution Name>
. Replace <Distribution Name>
with the name of the distribution you would like to install.
3. Once it is installed, it will show you “Installed Successfully”
4. Minimize the PowerShell and you will see that in Command prompt some instructions are there. Now you have to set your username and Password for the Ubuntu Operating System.
You have successfully installed Linux on Windows Operating System!
INSTALLING REDIS ON LINUX ON TOP OF WINDOWS OPERATING SYSTEM
Once you’re running Ubuntu on Windows, you can follow the steps to install recent stable versions of Redis from the official packages.redis.io
APT repository. Add the repository to the apt
index, update it, and then install:
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
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
sudo apt-get update
sudo apt-get install redis
Lastly, start the Redis server like so:
sudo service redis-server start
You can test that your Redis server is running by connecting with the Redis CLI:
redis-cli
127.0.0.1:6379> ping
PONG
You have installed Redis on your Ubuntu OS, and now close all your terminals.
- Open one command Prompt and enter “Ubuntu”.
- After executing the above code, it will take you to the Ubuntu OS, and now you have to start the redis server.
3. Open another terminal , and enter “ubuntu” to get into the ubuntu OS, and then you need to enter “redis-cli”
You have successfully installed Redis and and you can start working on it.