Logo

dev-resources.site

for different kinds of informations.

Install Redis Locally in Windows

Published at
1/6/2025
Categories
redis
Author
sachingeek
Categories
1 categories in total
redis
open
Author
10 person written this
sachingeek
open
Install Redis Locally in Windows

Redis is an in-memory database that actually makes it the fastest among all the databases.

What does "in-memory" mean? It means that it stores the data in temporary memory or RAM, in the form of key-value pairs. This makes it perfect for serving results instantly.

In this article, you’ll learn how to install Redis locally on Windows without any hassle.

Installation Process Begins

You probably don’t know that Redis isn’t officially available for Windows yet but there is a way that you can install Redis locally on Windows and get started with it.

Redis is available for MacOS, Linux but for Windows, they say:

Redis is not officially supported on Windows. However, you can install Redis on Windows for development.

So, how to install it then? Simple, actually not simple in my opinion but I will guide you step by step installing Redis on your Windows machine.

Enable WSL on Windows

To install Redis on Windows, you need to enable WSL (Windows Subsystem for Linux). It simply means that you need to install Linux on your Windows system.

To enable WSL, you must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.

You can enable the WSL2 (WSL version 2) by default with a single command.

Open Powershell in administrator mode and run the following command.

wsl --install 
Enter fullscreen mode Exit fullscreen mode

This command will enable the features necessary to run WSL and install the Ubuntu distribution of Linux.

You can change or install another distribution of Linux if you want to, just use the following command.

wsl --install -d <Distribution Name>
Enter fullscreen mode Exit fullscreen mode

You can replace <Distribution Name> with the actual Linux distribution you want to install on the Windows machine. But, I would recommend keeping the default settings.

After all this installation process, restart your Windows machine once to see the changes.

If your Windows machine is a bit older and WSL2 is not supported then check out this guide from Microsoft itself to manually enable WSL on Windows.

Troubleshooting Error

There will be less chance that you will get errors while setting up WSL but in case you encounter any error such as “failed to register wsl distribution” or something like that then consider changing the WSL version.

Run the following command in Powershell in administrator mode to change the version of your WSL.

wsl --set-default-version 1
Enter fullscreen mode Exit fullscreen mode

This command will change the default version which is WSL2 to WSL1. This will solve most of the problems.

Now, restart your Windows machine again to see the effect.

Set Up Linux

After enabling WSL and installing Linux distribution, you need to set up user info for Linux.

Open Ubuntu or whichever distribution you installed and give it a few minutes to install. After that, it will ask you to enter a username for Linux and set a password.

Creating Linux user account

After setting up the Linux distribution, the next step is to install Redis.

Install Redis on Windows

Redis can be installed on Windows using the following commands

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
Enter fullscreen mode Exit fullscreen mode

Copy the above commands all together and paste them into the Ubuntu terminal, this will start the process of installing Redis on Windows locally.

Collecting Redis package

Collecting Redis package

Updating

Installing Redis

Start Redis

Now run the following command to start the Redis server.

sudo service redis-server start
Enter fullscreen mode Exit fullscreen mode

Redis server

Now to check if you’re connected to Redis, run the following command.

redis-cli
Enter fullscreen mode Exit fullscreen mode

Redis CLI

Redis server started on localhost and listening on port 6379 which is its default port.


That’s all for now.

Keep Coding✌✌

redis Article's
30 articles in total
Favicon
Protect Your APIs from Abuse with FastAPI and Redis
Favicon
Token Bucket Rate Limiter (Redis & Java)
Favicon
A Simple Guide to Connect to Amazon ElastiCache Redis from Outside of Amazon
Favicon
Caching in Node.js: Using Redis for Performance Boost
Favicon
How to Install and Run Redis Directly on macOS (Without Homebrew)
Favicon
Install Redis Locally in Windows
Favicon
Redis: Powering Real-Time Applications with Unmatched Performance
Favicon
Why does clustering with redis suck?
Favicon
Fixed Window Counter Rate Limiter (Redis & Java)
Favicon
Redis Data Structures
Favicon
Pub-sub Redis in Micronaut
Favicon
Real-Time Data Indexing: Powering Instant Insights and Scalable Querying
Favicon
How to Implement Caching in PHP and Which Caching Techniques Are Best for Performance?
Favicon
tnfy.link - One more shortener?
Favicon
Lettuce - A Java Redis Client
Favicon
Introducing keyv-upstash: Seamless Key-Value Storage for Serverless Redis
Favicon
Sherlock Holmes: The Case Of Redis Overload During a DDoS Attack
Favicon
Real-Time Location Tracking with Laravel and Pulsetracker's Redis Pub/Sub
Favicon
Redis Cache - A String story
Favicon
Working on Redis streams? Don't forget these commands.
Favicon
Caching with Redis for Backend in Apache Superset
Favicon
Redis Queue and Cron in Go
Favicon
Infinite redis request
Favicon
Rate limiting with Redis: An essential guide
Favicon
What do 200 electrocuted monks have to do with Redis 8, the fastest Redis ever?
Favicon
FLAIV-KING Weekly (Flink AI Vectors Kafka) for 18 Nov 2024
Favicon
Building a Real-Time Flask and Next.js Application with Redis, Socket.IO, and Docker Compose
Favicon
Spring Boot + Redis: A Beginner-Friendly Guide to Supercharging Your App’s Performance
Favicon
Boosting Speed and Performance with Advanced Caching in NestJS: How to Use AVL Trees and Redis
Favicon
I used GitHub as a CMS

Featured ones: