How to install redis on MacOS using Homebrew

Using homebrew you can install redis on MacOS. This article will cover how to install and start redis. Hit the following command to install redis

$ brew install redis

Get redis package information:

$ brew info redis

Launch Redis on computer startup:

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

Start redis server using launchctl:

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Start redis server using configuration file:

$ redis-server /usr/local/etc/redis.conf

Here /usr/local/etc/redis.conf is the location of redis configuration file. You can pass different path.

Stop redis on auto startup:

$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

To uninstall redis:

$ brew uninstall redis
$ rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

Test if redis server is up or not:

$ redis-cli ping

This command should return PONG response.

Tags:

Categories:

Updated: