As a database, cache, and message broker, Redis is an open-source in-memory data structure store. The reason Redis differs from conventional databases is that it can store higher-level data types including lists, sets, maps, and more. Redis is highly advised for use to enhance your VPS because to its user-friendly interfaces and amazing functionality.
We’ll show you how to set up your Redis server in your Linux VPS server in this article. Since the server will by default search for connections from all accessible interfaces on the server, customising it will enable the server to listen to the interface of your choice. Access your VPS server before making any configurations.
Step 1: Locate Configuration File
We must first find the file’s location and open it. The configuration file can be found in “/etc/redis/redis.conf” by default. Use your preferred text editor to open the file. Run the following command to open the file in a nano text editor.
sudo nano /etc/redis/redis.conf
Step 2: Configuration
After opening the configuration, locate the line that says “bind 127.0.0.1”. Change the IP address by entering the values of the interface you want the Redis server to listen to, such as the following example.
To add more IP addresses, you may do so by having a space in between every IP address, like the following example.
bind 126.96.36.199 188.8.131.52
For the Redis server to listen to all the interfaces on the network, use the following command.
Finally, after finishing your configuration, make save changes and close the file. To implement the changes, restart the Redis server using the following command.
sudo systemctl restart redis-server