How to Install Redis on Ubuntu 18.04 & 20.04 LTS

Redis is an open-source in-memory information structure store. It very well may be utilized as a database, store and message agent and supports different information structures, for example, Strings, Hashes, Lists, Sets and so on. Redis gives high accessibility by means of Redis Sentinel including observing, notices Automatic failover. It likewise gives programmed apportioning over different Redis hubs with Redis Cluster.


In this post, We will install and configure redis on ubuntu 16.04 and 18.04

Step 1: Update System


You need to first update the ubuntu current repository by using the given command.


sudo apt-get update



Step 2: Install Redis

To install Redis by following the command.
 

sudo apt-get install redis-server -y



After installation of Redis, You will get the Redis service in running state, To get the information, Use the following command.

sudo systemctl status redis-server



Step 3: Bind with IP

Of course, Redis doesn’t permit remote associations. You can associate with the Redis server just from 127.0.0.1 (localhost) – the machine where Redis is running.

Play out the accompanying advances just on the off chance that you need to associate with your Redis server from remote hosts. In the event that you are utilizing a solitary server arrangement, where the application and Redis are running on a similar machine then you ought not empower remote access.

To design Redis to acknowledge remote associations open the Redis arrangement record with your word processor:
 

sudo vim /etc/redis/redis.conf



and Locate the line that begins with bind 127.0.0.1 ::1 and replace 127.0.0.1 with 0.0.0.0.

After this restart the Redis-server, To get changes in Redis, Use the given command for that.

sudo systemctl restart redis-server



Use the following command to verify that redis is listening on all interfaces on port 6379:

sudo netstat -plntu | grep 6379

Step 4: Update UFW Firewall

If you have enabled UFW firewall so then, You need to allow 6379 port by using the command.

sudo ufw allow 6379
sudo ufw reload


Ensure your firewall is arranged to acknowledge associations just from believed IP ranges.

Step 5: Testing Redis

To confirm that everything is set up appropriately, you can attempt to ping the Redis server from your remote machine utilizing the redis-cli utility:

redis-cli 



Once you have logged in type ping, You will get PONG in reply that means, Your redis working fine.


Conclusion
 

We have successfully installed redis server on ubutnu 18.04 LTS, Still you have any issue feel free and leave comment.

How to Install Redis on Ubuntu 18.04 & 20.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top