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:

  1. Installing or enabling WSL2 (Windows Subsystem for Linux):
  2. 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
  3. Setting Linux user info:
  4. 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.

  5. Checking Running version of WSL:
  6. Open command prompt or Windows PowerShell and run the following command to check version:

    wsl -v

    Command to check Linux distribution:

    wsl -l -v
  7. Installing Redis Server:
  8. 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
    
  9. Running Redis Server:
  10. 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