Blog

Thoughts from my daily grind

Installing Redis (server and client) on macOS

Posted by Ziyan Junaideen |Published: 12 November 2021 |Category: Apple
Default Upload |

For the last 8 years I have worked on 40+ Ruby projects and Redis was an integral part of all of them. Redis remains my favorite to cache values and holds on to things temporarily (with a TTL). This tutorial describes how you install and use Redis in your Mac (iMac, MacBook, MacMini) running macOS.

Note: I would be assuming you have Homebrew installed already. If not, you should. It makes installing libraries in macOS so much easier.

Procedure

Step 1: Update brew and install

brew update
brew install redis

This will give access to redis-server and redis-cli. But by default the service won't be running.

Step 2: Start the redis service

brew services start redis

Step 3: You can now use redis as you wish

jdeen@iMac:~/Desktop|⇒  redis-cli
127.0.0.1:6379>

Extra

You can check if Redis is running using:

jdeen@iMac:~/Desktop|⇒  redis-cli ping
PONG

Like you started the service, you can stop it:

brew services redis stop
Tags
About the Author

Ziyan Junaideen -

Ziyan is an expert Ruby on Rails web developer with 8 years of experience specializing in SaaS applications. He spends his free time he writes blogs, drawing on his iPad, shoots photos.

Comments