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



macOS % redis-cli

Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>

If you are trying to connect to the redis-cli and you get an error connecting to redis at localhost port 6379 then the fix is simple, first make sure that the Redis server is running, if not, then run the below command in the terminal to turn it on

redis-server

macOS

If Redis is not installed on your Mac, then you can install it using the brew package manager,

brew install redis

Next, you can start the server as follows,

brew services start redis

Linux

If you are on a Linux system, then you can install Redis as follows.

sudo apt-get install redis

And we can start the Redis server as follows,

sudo service redis start
Start Redis Server
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap