Logo

dev-resources.site

for different kinds of informations.

How to Install Redis on Windows Using WSL2

Published at
7/22/2024
Categories
redis
windows
wsl
tutorial
Author
azzamaddouri
Categories
4 categories in total
redis
open
windows
open
wsl
open
tutorial
open
Author
12 person written this
azzamaddouri
open
How to Install Redis on Windows Using WSL2

Redis is not officially supported on Windows. However, you can install Redis on Windows by enabling the Windows Subsystem for Linux (WSL2), which lets you run Linux binaries natively on Windows. In this brief tutorial, I'll guide you step by step to install Redis on Windows. ๐Ÿš€

Step-by-Step Guide

  1. Enable WSL2:

    • Open PowerShell as an administrator and run:
     Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    

PowerShell command to enable WSL2

  1. Install a Linux Distribution:

    • Launch the Microsoft Store by running:
     start ms-windows-store:
    

PowerShell command to launch Microsoft Store

  • Search for "Ubuntu" and install it.
    Search for Ubuntu in Microsoft Store

  • Open Ubuntu and enter a new Unix username and password when prompted.

  1. Set Up Redis:

    • Run the following commands in the Ubuntu terminal to install Redis:
     curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
    

Ubuntu terminal command to download Redis GPG key

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

Ubuntu terminal command to add Redis repository

 ```bash
 sudo apt-get update
 ```
Enter fullscreen mode Exit fullscreen mode

Ubuntu terminal command to update package lists

 ```bash
 sudo apt-get install redis
 ```
Enter fullscreen mode Exit fullscreen mode

Ubuntu terminal command to install Redis

  1. Start the Redis Server:

    • After the installation is complete, start the Redis server with:
     sudo service redis-server start
    

Ubuntu terminal command to start Redis server

  1. Connect to Redis:

    • Test that your Redis server is running by connecting with the Redis CLI:
     redis-cli
     127.0.0.1:6379> ping
    

Redis CLI ping response

Congratulations! You've successfully installed Redis on Windows. ๐ŸŽ‰ Happy coding! I hope this helps you! ๐Ÿ˜Š

References

wsl Article's
30 articles in total
Favicon
Update WSL Ubuntu password
Favicon
Building OpenCV 4.10.0 with GUI Support in WSL
Favicon
Video: Install Ubuntu using WSL 2
Favicon
Install Zellij on WSL
Favicon
Work from anywhere with VSCode Remote Tunnels
Favicon
SSL verification error at depth 2 - Zscaler | WSL
Favicon
Accelerate 1-bit LLM Inference with BitNet on WSL2 (Ubuntu)
Favicon
Just start using WSL
Favicon
Change WSL/Docker files to another disk
Favicon
Setup your laravel 11 in windows
Favicon
Install Ubuntu on WSL 2
Favicon
How to Install WSL from PowerShell on Windows 10 and 11
Favicon
WSL in AWS Windows Server 2022 Core instance
Favicon
Docker Installation Log for WSL 2 on Windows
Favicon
Enable WSL shell in GitHub Desktop
Favicon
Installing Ruby using rbenv on your WSL Ubuntu system
Favicon
How to Install Redis on Windows Using WSL2
Favicon
PowerShell Development in Neovim
Favicon
WSL: Gerenciando o disco da distro
Favicon
Docker
Favicon
Share Postgresql from Windows to WSL Linux
Favicon
Add Manjaro into WSL 2
Favicon
Using WSL2 as primary driver for 3 months with Fedora
Favicon
Wsl installation error
Favicon
Install Debian in Different Location -WSL Windows
Favicon
Monitor GPU Usage in WSL debian
Favicon
Dicas e configuraรงรตes para seu sistema linux
Favicon
Instalando de maneira rรกpida e eficiente suas ferramentas no WSL. Pt-3
Favicon
Arch install azure cli
Favicon
Melhorando e configurando seu novo Shell linux. Pt-2

Featured ones: