Press Ctrl/Cmd + P to print
or save as PDF

Configure Redis on Linux VPS Server in 2 Simple Steps

Redis is an open-source, in-memory data structure store, which is used as a database, cache, and message broker. Redis stands out from other databases is due to it being able to store higher-level data such as lists, sets, maps, and more. It is highly recommended to use Redis to improve your VPS with its user-friendly interfaces as well as for its exceptional features.

In this article, we will guide you on how to configure your Redis server in your Linux VPS server. The reason for configuring it is to allow the server to listen to the interface of your own preferences as the server will look for connections from all interfaces available on the server by default. Before making any configurations, access your VPS server with SSH.

Step 1: Locate Configuration File

Firstly, we will need to locate where the file is and open it. By default, the configuration file is located at “/etc/redis/redis.conf” Open the file with a text editor of your own preference. To open the file with a nano text editor, run the following command.

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.

bind 192.168.43.2

To add more IP addresses, you may do so by having a space in between every IP address, like the following example.

bind 192.169.43.2 19.168.43.3

For the Redis server to listen to all the interfaces on the network, use the following command.

bind 0.0.0.0

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