sudo apt update
sudo apt install redis-server
brew install redis
Redis doesn't officially support Windows, but you can use the Windows Subsystem for Linux (WSL) or download the Microsoft-maintained version from https://github.com/microsoftarchive/redis/releases
If you're familiar with Docker, you can run Redis in a container:
docker run --name my-redis -p 6379:6379 -d redis
After installation, you can verify that Redis is running:
redis-cli ping
If Redis is running correctly, it should respond with "PONG".
On most Unix-like systems:
sudo service redis-server start
Or:
redis-server
The Redis configuration file is usually located at /etc/redis/redis.conf
. You might want to review and adjust settings like:
bind 127.0.0.1
(to only allow local connections)port 6379
(the default port)maxmemory 100mb
(to set a memory limit)maxmemory-policy allkeys-lru
(to evict keys when max memory is reached)
Remember to restart Redis after changing the configuration.