Installing Redis
Installing Redis depends on your operating system. Here are the steps for Ubuntu (Linux), macOS, and Windows:
Ubuntu (Linux)
- Update your system:
sudo apt update sudo apt upgrade -y - Install Redis:
sudo apt install redis-server - Start Redis:
sudo systemctl start redis sudo systemctl enable redis - Test Redis installation:
redis-cli pingYou should see a response:
PONG.
macOS
- Install Homebrew if you haven’t already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install Redis using Homebrew:
brew install redis - Start Redis:
brew services start redis - Test Redis installation:
redis-cli pingYou should see a response:
PONG.
Windows
- Enable WSL2 (Windows Subsystem for Linux): Follow Microsoft’s instructions to enable WSL2, choosing Ubuntu as the distribution.
- Install Redis in the WSL Ubuntu environment:
sudo apt update sudo apt install redis-server - Start Redis:
sudo systemctl start redis sudo systemctl enable redis - Test Redis installation:
redis-cli pingYou should see a response:
PONG.
These steps will get you up and running with Redis on your preferred operating system.