Install Redis on Mac OS via Homebrew

Install Redis on Mac OS via Homebrew

  • Install redis package
    $ brew install redis
    Updating Homebrew...
    ==> Auto-updated Homebrew!
    
  • After installation, you’d see the following message:
     ==> Downloading https://homebrew.bintray.com/bottles/redis-5.0.4.mojave.bottle.tar.gz
     ############################################################# 100.0%
    ==> Pouring redis-5.0.4.mojave.bottle.tar.gz
    ==> Caveats
    To have launchd start redis now and restart at login:
      brew services start redis
    Or, if you don't want/need a background service you can just run:
    redis-server /usr/local/etc/redis.conf
    
  • Run redis as following:
    $ redis-server /usr/local/etc/redis.conf
    oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
    

Connect to Redis with redis-cli

redis-cli 5.0.4

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
  -p <port>          Server port (default: 6379).
    -n <db>            Database number.
$ redis-cli -h <host> -p <port> -n <db>
Advertisements