How to install Redis in MacOs?

Redis is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, and sorted sets. Redis is known for its high performance, scalability, and ease of use.

Install Homebrew

Before we install the Redis application, we need to check that we have Homebrew with this command in your terminal.

brew -v

It should print a message like this.

check-homebrew

If you don't see a message like that, install Homebrew with this command.

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

Install Redis

Now after installing homebrew we now can use brew to install redis.

brew install redis

redis

After finish installing start the redis service using this command.

brew services restart redis

Now check if the redis service is already running or not.

redis-cli ping

If everything goes well, you should receive a reply message from the Redis server.

PONG