Installing Redis on Windows, macOS, and Linux:

installing Redis on Windows, macOS, and Linux:


Redis Installation Guide

1. Windows

Redis doesn’t have an official native Windows build anymore, but you can run it via:

Option A – Using WSL (Windows Subsystem for Linux)

  1. Enable WSL (if not already enabled):

    • Open PowerShell as Administrator:

      wsl --install
      
    • Restart your PC if prompted.
  2. Install Ubuntu (or another Linux distribution) from the Microsoft Store.
  3. Update & Install Redis inside WSL:

    sudo apt update
    sudo apt install redis-server
    
  4. Start Redis:

    sudo service redis-server start
    
  5. Test Redis:

    redis-cli ping
    

    Output should be:

    PONG
    

Option B – Using Docker

  1. Install Docker Desktop for Windows.
  2. Pull and run Redis:

    docker run --name redis -p 6379:6379 -d redis
    
  3. Connect with:

    docker exec -it redis redis-cli
    

2. macOS

  1. Install Homebrew (if not installed):

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install Redis:

    brew install redis
    
  3. Start Redis service:

    brew services start redis
    
  4. Test Redis:

    redis-cli ping
    

Option B – Using Docker

  1. Install Docker for Mac.
  2. Run Redis container:

    docker run --name redis -p 6379:6379 -d redis
    

3. Linux (Ubuntu/Debian)

Apt Package Manager

  1. Update system:

    sudo apt update
    
  2. Install Redis:

    sudo apt install redis-server
    
  3. Enable Redis to start on boot:

    sudo systemctl enable redis
    
  4. Start Redis:

    sudo systemctl start redis
    
  5. Verify:

    redis-cli ping
    

4. Linux (CentOS/RHEL)

YUM/DNF

  1. Install EPEL repository:

    sudo yum install epel-release
    
  2. Install Redis:

    sudo yum install redis
    
  3. Start and enable Redis:

    sudo systemctl start redis
    sudo systemctl enable redis
    
  4. Test:

    redis-cli ping
    

Previous Post Next Post