Install Redis Community Edition on macOS
How to install Redis Community Edition on macOS using Homebrew
Redis Community Edition |
---|
Install Redis Community Edition (CE) on macOS using Homebrew
To install Redis CE on macOS, use Homebrew. Make sure that you have Homebrew installed before starting on the installation instructions below.
There are two brew casks available.
redis
contains the latest, stable version of Redis.redis-ce
contains the latest pre-release version of Redis, for example Redis CE 8.0-RC1.
Install using Homebrew
First, tap the Redis CE Homebrew cask:
brew tap redis/redis
Next, run brew install
:
brew install --cask redis
Run Redis
If this is the first time you've installed Redis on your system, you need to be sure that your PATH
variable includes the Redis installation location. This location is either /opt/homebrew/bin
for Apple silicon Macs or /usr/local/bin
for Intel-based Macs.
To check this, run:
echo $PATH
Next, confirm that the output contains /opt/homebrew/bin
(Apple silicon Macs) or /usr/local/bin
(Intel Mac). If neither /opt/homebrew/bin
nor /usr/local/bin
are in the output, add them.
Open the file ~/.bashrc
or ~/zshrc
(depending on your shell), and add the following line.
export PATH=$(brew --prefix)/bin:$PATH
You can now start Redis server as follows:
redis-server
brew tap
command, it will not be integrated with the brew services
command.Connect to Redis CE
Once Redis is running, you can test it by running redis-cli
:
redis-cli
Test the connection with the ping
command:
127.0.0.1:6379> PING
PONG
Uninstall Redis CE
To uninstall Redis CE, run:
brew uninstall redis
brew untap redis/redis
Next steps
Once you have a running Redis instance, you may want to:
- Try the Redis CLI tutorial
- Connect using one of the Redis clients
- Connect using Redis Insight