Software⏱️ 2 min read📅 2026-06-03

How to Fix: Could not connect to Redis at 127.0.0.1:6379: Connection refused with homebrew

Check Redis configuration file and ensure it is listening on all available network interfaces.

Quick Answer: Try running `brew services start redis` to restart Redis service, or edit the Redis configuration file (`/usr/local/etc/redis.conf`) to include `bind 0.0.0.0` to listen on all interfaces.

To resolve the 'Connection refused' error when trying to connect to Redis on macOS Sierra using homebrew, first ensure that Redis is properly installed and running. Check if Redis is listening on the default port by running the command `redis-server --port 6379` in the terminal.

🛠️ Step-by-Step Verified Fixes

Method 1: Enable Redis Service

  1. Step 1: Open the Terminal and run `brew services start redis` to enable the Redis service.

Method 2: Configure Firewall Exemptions

  1. Step 1: Open the Terminal and run `sudo pfload -f /usr/local/etc/pf.conf` to reload the firewall rules.

🎯 Final Words

After enabling the Redis service or configuring firewall exemptions, try pinging Redis again using `ping 127.0.0.1:6379`. If you're still facing issues, consider reinstalling Redis using `brew install redis` and then running `redis-server --port 6379` to start the service.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions