Skip to content

Instantly share code, notes, and snippets.

@emotality
Last active September 5, 2019 06:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emotality/a5b7d846b80210ca94913bc8e7f2fb89 to your computer and use it in GitHub Desktop.
Save emotality/a5b7d846b80210ca94913bc8e7f2fb89 to your computer and use it in GitHub Desktop.
Install Redis on macOS

Redis on macOS

If you don't have Homebrew, install it:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

After Homebrew is install, use Homebrew to install Redis

$ brew install redis

Launch Redis on startup

$ cp /usr/local/opt/redis/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

If you get No such file or directory error, create the LaunchAgents folder with mkdir ~/Library/LaunchAgents/

Start Redis

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

Test

$ redis-cli ping
# Expect: PONG

Tips

Flush Redis

$ redis-cli flushall

Get all keys

$ redis-cli
127.0.0.1:6379> keys *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment