skip to Main Content

I need to install redis version 5.0.14 on my mac using brew.

I have tried multiple ways like brew install [email protected], [email protected], redis@50, redis@5 but nothing seems to work!!

I was able to find out on https://formulae.brew.sh/ that the options that can be installed using brew are redis, [email protected], [email protected] . But I need to install redis 5.0.14 or basically above 5.0.6 because that is the version we have on our production. Can anyone help me out on this?

I have seen a way here that suggests to checkout specific homebrew formulae version but that would become too messy if something goes wrong. I would prefer a straight forward way if there is one.

3

Answers


  1. The version you’re looking for is not available on brew unfortunately.

    bruno@pop-os ~> brew info --json redis | jq -r '.[].versioned_formulae[]'
    [email protected]
    [email protected]
    

    You could get the source code from here: https://github.com/redis/redis/releases/tag/5.0.14

    extract it to some directory, to run Redis with the default configuration just type:

    % cd src
    % ./redis-server
    

    If you want to provide your redis.conf, you have to run it using an additional
    parameter (the path of the configuration file):

    % cd src
    % ./redis-server /path/to/redis.conf
    

    It is possible to alter the Redis configuration by passing parameters directly
    as options using the command line. Examples:

    % ./redis-server --port 9999 --replicaof 127.0.0.1 6379
    % ./redis-server /etc/redis/6379.conf --loglevel debug
    

    All the options in redis.conf are also supported as options using the command
    line, with exactly the same name.

    Optionally you could use Docker, docker run --name some-redis -d redis:5.0.14

    Login or Signup to reply.
  2. Given that the Redis version you require is not available via homebrew, your question is unanswerable. However, given how good docker is on macOS, I have taken to using that rather than homebrew for lots of version-related problems.

    With docker:

    • I can pull any version I want,
    • it’s all isolated from my core macOS,
    • just as performant,
    • readily deletable,
    • simple to have many versions,
    • switchable between versions,
    • repeatable across platforms and
    • configurable by script.

    Official image here.


    So, in concrete terms, you could run Redis 5.0.14 as a daemon like this:

    docker run --name some-redis -d redis:5.0.14
    

    and then connect to that same container and run redis-cli inside it like this:

    docker exec -it some-redis redis-cli PING
    PONG
    

    Or you could run Redis in the container but expose its port 6379 as port 65000 to your regular macOS applications like this:

    docker run --name some-redis -p 65000:6379 -d redis:5.0.14
    

    Then it is accessible to your macOS applications, such as redis-cli like this:

    redis-cli -p 65000 info | grep redis_version
    redis_version:5.0.14
    
    Login or Signup to reply.
  3. brew update
    brew install redis
    

    To have launchd start redis now and restart at login:

    brew services start redis
    

    To stop it, just run:

    brew services stop redis
    

    Test if Redis server is running.

    redis-cli ping
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search