Redis is a flexible, high-performance database engine which supports complex operations and use-cases. You can setup a Redis server to run on your VPS and accept remote commands to modify, read, and perform operations on the database.
Step 1: Install the Redis backend
|RHEL / CentOS / Amazon Linux||sudo yum install redis|
|Ubuntu / Debian||sudo apt-get install redis-server|
|Fedora||sudo dnf -y install redis|
Step 2: Start the Redis server backend service
|RHEL / CentOS / Amazon Linux||sudo systemctl start redis|
|Ubuntu / Debian||sudo systemctl start redis-server.service|
|Fedora||sudo systemctl start redis|
Step 3: Verify the Redis server is running
You can also verify the server is handling requests by starting the redis-cli and issuing the ping command.
Step 4: Get public IPv4 address using ifconfig
Step 5: Bind the Redis server to your IPv4 address.
By default the Redis server will be bound to 127.0.0.1 which is only accessible from the server itself. To make the Redis server publicly accessible, you must bind the server to listen on network interface associated with your public IPv4.
On line 66, modify bind 127.0.0.1 and replace the IP with your VPS IPv4
Step 6: Restart Redis
|RHEL / CentOS / Amazon Linux||sudo systemctl restart redis|
|Ubuntu / Debian||sudo systemctl restart redis.service|
|Fedora||sudo systemctl restart redis|
Step 7: Verify external host access
Verify the server can be accessed from an external host. Using the redis-cli command on your local machine, you can provide the -h <hostname> argument to connect to the remote Redis server that was just setup on your VPS.
You are now able to remotely access your Redis node on your VPS.