Skip to content

Installing Redis

Redis does not officially support Windows natively. You have two options:

Option 1: WSL2 (Recommended)

Terminal window
# Install WSL2 first, then inside Ubuntu terminal:
sudo apt update
sudo apt install redis-server -y
sudo service redis-server start

Option 2: Use Docker (see Section 17)


Terminal window
# Update package list
sudo apt update
# Install Redis
sudo apt install redis-server -y
# Start Redis service
sudo systemctl start redis-server
# Enable Redis to start on boot
sudo systemctl enable redis-server
# Check status
sudo systemctl status redis-server

Terminal window
# Install via Homebrew
brew install redis
# Start Redis as a background service
brew services start redis
# Or start manually in the foreground
redis-server

Terminal window
# Pull and run Redis
docker run --name my-redis -p 6379:6379 -d redis
# Verify it's running
docker ps
# Connect to Redis CLI inside the container
docker exec -it my-redis redis-cli

Terminal window
# Start Redis server
redis-server
# Open a new terminal and connect with CLI
redis-cli
# Test connection — Redis should reply PONG
127.0.0.1:6379> PING
PONG
# Set a test key
127.0.0.1:6379> SET hello "Redis is working!"
OK
# Get the value back
127.0.0.1:6379> GET hello
"Redis is working!"

Tip: Redis CLI connects to 127.0.0.1:6379 by default. For a remote host, use redis-cli -h <host> -p <port>.