Install and Run Redis Server on Windows
Redis stands for Remote Dictionary Server. It is an open-source, in-memory data store and caching system.
Redis is not officially supported on Windows. However, we can install Redis on Windows for development by following these instructions:
- Installing or enabling WSL2 (Windows Subsystem for Linux):
- Setting Linux user info:
- Checking Running version of WSL:
- Installing Redis Server:
- Running Redis Server:
Install WSL2 via Windows PowerShell. It allows to run Linux binaries natively on Windows. For this to work, your system must be running Windows 10 or later:
wsl --install
Once you have installed WSL, you will need to restart you computer. After restart, create a user account and password for your newly installed Linux distribution.
Open command prompt or Windows PowerShell and run the following command to check version:
wsl -v
Command to check Linux distribution:
wsl -l -v
Open a Windows PowerShell and run the following command to run Ubuntu on Windows:
wsl
Next to install Redis, run the following commands one by one:
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
Start the Redis server using the following command:
sudo service redis-server start
Test to check that your Redis server is running by connecting with the Redis CLI:
redis-cli 127.0.0.1:6379> ping PONG