Redis Installation & Configuration

  1. To install redis run the below command.

sudo apt install redis-server

           

  1. Once redis is installed, you can check if the installation was successful by running the following command.

redis-cli --version


  1. Check if the redis instance is running.

sudo systemctl status redis-server


  1. The default redis configuration file is located in the /etc/redis/redis.conf directory. Open the file using any text editor.

sudo nano  /etc/redis/redis.conf


  1. Locate the line bind 127.0.0.1 -::1 and change the IP address to the IP address of your network.


  1. Locate the word requirepass and replace it with requirepass some-password.


  1. Save the changes and close the file.


  1. Restart redis service to apply the changes.

sudo systemctl restart redis-server