Finding the Redis config file in macOS

4.4k Views Asked by At

I have installed Redis on my Mac and now I am trying to access Redis config file redis.conf. Where is it located in macOS?

I have tried looking at various resources, but could not find any helpful information.

3

There are 3 best solutions below

0
On

If Redis is running and you can access it with redis-cli - try INFO command. It would expose the location of the config file as the config_file: field.

Example:

$ redis-cli INFO | grep config_file

There is a chance, however, that the Redis was launched without any config file. Then the config_file: would be empty.

You can also start Redis with the specific config file like:

$ </path/to/>redis-server  </path/to/>redis.conf

To find the location of redis-server executable, you can once again use the INFO command:

$ redis-cli INFO | grep executable

For more information refer to the Redis documentation.

0
On

I was confused with the redis having redis.conf file, tried a lot of methods to find it but was unable to find it out. here is where I found out in my machine (Mac OS).

  1. ls /opt/homebrew/etc/redis.conf
  2. ls /opt/homebrew/bin/redis.conf
  3. ls /etc/redis/redis.conf
  4. ls /etc/redis.conf
  5. ls /var/lib/redis/redis.conf

For me it was inside /opt/homebrew/etc

enter image description here

0
On

For those who installed redis-stack-server with Homebrew: I found the config file at /opt/homebrew/Caskroom/redis-stack-server/<<VERSION>>/etc/redis-stack.conf.