1- Find redis config file
On Linux:
usually it is at:
/etc/redis/redis.conf
On MacOS
if you are using Homebrew you will find it at:
/opt/homebrew/etc/redis.conf
2- find requirepass
uncommit it if it is commented by removing the hash # before it and set the password after requirepass word
# IMPORTANT NOTE: starting with Redis 6 "requirepass" is just a compatibility
# layer on top of the new ACL system. The option effect will be just setting
# the password for the default user. Clients will still authenticate using
# AUTH <password> as usually, or more explicitly with AUTH default <password>
# if they follow the new protocol: both will work.
#
# The requirepass is not compatable with aclfile option and the ACL LOAD
# command, these will cause requirepass to be ignored.
#
# requirepass XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX