Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

You can use launchctl to start and stop redis

$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.redis.plist
$ launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.redis.plist

You can also more conveniently use brew to start, stop, and verify service status

$ brew services list | grep redis
$ brew services start redis
$ brew services stop redis

Notes

The default plist provided by homebrew stores the redis configuration at /usr/local/etc/redis.conf.

For more about launchctl see:

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/launchctl.1.html#//apple_ref/doc/man/1/launchctl

http://launchd.info/

@beyonddoor

This comment has been minimized.

Copy link

commented Jun 28, 2015

it seems services isn't a valid brew command

@liuzxc

This comment has been minimized.

Copy link

commented Jul 6, 2015

I met the error as below:

/Users/liuxingqi/Library/LaunchAgents/homebrew.mxcl.redis.plist: Invalid property list

@yazinsai

This comment has been minimized.

Copy link

commented Sep 3, 2015

To get the services command, first do brew tap homebrew/services

@gogobook

This comment has been minimized.

Copy link

commented Sep 16, 2015

It cool. thank you @yazinsai.

@benjaminfauchald

This comment has been minimized.

Copy link

commented Oct 10, 2015

thanks @yazinsai.

@Bartuz

This comment has been minimized.

Copy link

commented Oct 23, 2015

Thanks!
These instructions should be added to brew info redis.

@mikeryz-rosie

This comment has been minimized.

Copy link

commented Jan 15, 2016

It looks like brew services list now taps that automatically 😄

@wenweih

This comment has been minimized.

Copy link

commented Mar 29, 2016

@arthurbryant

This comment has been minimized.

Copy link

commented Jun 14, 2017

Not sure why, but I need to start and stop redis with sudo, otherwise, it will not be started.

sudo brew services start redis
sudo brew services stop redis
@JavascriptNinja815

This comment has been minimized.

Copy link

commented Apr 11, 2018

Thanks, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.