Skip to content

Instantly share code, notes, and snippets.

@tomysmile
Last active March 18, 2024 22:12
Show Gist options
  • Save tomysmile/1b8a321e7c58499ef9f9441b2faa0aa8 to your computer and use it in GitHub Desktop.
Save tomysmile/1b8a321e7c58499ef9f9441b2faa0aa8 to your computer and use it in GitHub Desktop.
Brew install Redis on Mac

type below:

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

Or, if you don't want/need a background service you can just run:

redis-server /usr/local/etc/redis.conf

Test if Redis server is running.

redis-cli ping

If it replies “PONG”, then it’s good to go!

Location of Redis configuration file.

/usr/local/etc/redis.conf

Uninstall Redis and its files.

brew uninstall redis
rm ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
@alonre
Copy link

alonre commented Sep 17, 2021

Great, thanks! 👍

@Gogicool-geek
Copy link

Thanks!

@RuslanSevrukov
Copy link

The BEST!

@CyprianTinasheAarons
Copy link

Thanks

@denys-kobzar
Copy link

How to run brew redis with loaded specific module ?
for example "redis-server --loadmodule ./target/release/librejson.dylib" for adding json module, but how can i do it with brew version of redis ? thx in advance

@gagandeepsingh-dev
Copy link

Thanks

@virendra-maurya
Copy link

Thanks @tomysmile

@utsavo-afk
Copy link

Thank you!!

@elliottwu-noodoe
Copy link

Thanks, nice and clean.

@sameer-azazi-tw
Copy link

Thanks

@SaschaHeyer
Copy link

Thanks, always come back here :D:D

@saulhappy
Copy link

Should be the second result when searching for Redis!

@z851103999
Copy link

thank you

@nkpremices
Copy link

Thank you

@aamnapm
Copy link

aamnapm commented Dec 12, 2021

Thanks

@hoist1999
Copy link

Great thanks.

@CyberPunkCodes
Copy link

For myself for future reference, or anyone else interested :)

You can make redis run in the background and add helpful aliases to start/stop/test redis:

In your redis.conf, /usr/local/etc/redis.conf, set daemonize yes, and it will run in the background.

Then add the following aliases:

alias redis.start="redis-server /usr/local/etc/redis.conf"
alias redis.stop="pkill redis-server"
alias redis.test="redis-cli ping"

@Wizkaley
Copy link

Thank You

@gitNavV
Copy link

gitNavV commented Jan 19, 2022

Thanks!

@ihsanbazli
Copy link

many thanks!

@pleblond
Copy link

Thanks

@tolumide-ng
Copy link

Thank you!

@balagopal-waterlabs
Copy link

Thanks its working

@SalashnyiTaras
Copy link

thanks you!

@idmitrymolchanov
Copy link

Thanks!

@heeropunjabi
Copy link

thank you!

@ATSiem
Copy link

ATSiem commented Feb 16, 2022

Perfect!

@alekseyl-workato
Copy link

alekseyl-workato commented Feb 18, 2022

If you need to configure brew-driven redis, then configuration could be found here:

/opt/homebrew/etc/redis.conf

@DataGreed
Copy link

To restart redis after an upgrade:

  brew services restart redis

Or, if you don't want/need a background service you can just run:

  /usr/local/opt/redis/bin/redis-server /usr/local/etc/redis.conf

@Goodnessuc
Copy link

This is saving lives

@ntung
Copy link

ntung commented Sep 2, 2022

Thanks for your awesome work!

@cybernerdie
Copy link

Thanks for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment