Re_Backend/docs/REDIS_SETUP_WINDOWS.md

2.2 KiB

Redis Setup for Windows

Method 1: Using Memurai (Redis-compatible for Windows)

Memurai is a Redis-compatible server for Windows.

  1. Download Memurai:

  2. Install:

    • Run the installer
    • Choose default options
    • It will automatically start as a Windows service
  3. Verify:

    # Check if service is running
    Get-Service Memurai
    
    # Or connect with redis-cli
    memurai-cli ping
    # Should return: PONG
    
  4. Configure (if needed):

    • Default port: 6379
    • Service runs automatically on startup

Method 2: Using Docker Desktop

  1. Install Docker Desktop:

  2. Start Redis Container:

    docker run -d --name redis -p 6379:6379 redis:7-alpine
    
  3. Verify:

    docker ps | Select-String redis
    

Method 3: Using WSL2 (Windows Subsystem for Linux)

  1. Enable WSL2:

    wsl --install
    
  2. Install Redis in WSL:

    sudo apt update
    sudo apt install redis-server
    sudo service redis-server start
    
  3. Verify:

    redis-cli ping
    # Should return: PONG
    

Quick Test

After starting Redis, test the connection:

# If you have redis-cli or memurai-cli
redis-cli ping

# Or use telnet
Test-NetConnection -ComputerName localhost -Port 6379

Troubleshooting

Port Already in Use

# Check what's using port 6379
netstat -ano | findstr :6379

# Kill the process if needed
taskkill /PID <PID> /F

Service Not Starting

# For Memurai
net start Memurai

# Check logs
Get-EventLog -LogName Application -Source Memurai -Newest 10

Configuration

Default Redis/Memurai configuration works out of the box. No changes needed for development.

Connection String: redis://localhost:6379

Production Considerations

  • Use Redis authentication in production
  • Configure persistence (RDB/AOF)
  • Set up monitoring and alerts
  • Consider Redis Cluster for high availability

Recommended for Windows Development: Memurai (easiest) or Docker Desktop