How to Install Redis on Ubuntu?

Redis called as Remote Dictionary Server. Redis is an Open-Source in-memory data structure server. It is used as cache storage and Database. Redis stores a mapping of keys to five different types of values. Redis is also useful to run task queues in the server background.

Following are the steps to install Redis on Ubuntu Server.

Install Redis Server :

  1. Execute the below command to install Redis.

    # sudo apt-get install redis-server -y
  2. Hit the below command to check that the Radis is working.

    # redis-cli
  3. If the installation is successful, Redis will open a command-line interface. Hit below command to check it is working fine.

    # 127.0.0.1:6379> PING

          If you receive PONG in response, this means Radis is installed properly on your server.

  1. Hit EXIT command to exit from Radis-cli.

    # 127.0.0.1:6379> EXIT

          Let us configure Redis for Memory Usage Limit and Password.

Configure Redis Server :

  1. Redis configuration file will be at “/etc/redis/redis.conf”. Edit the configuration file with your favorite editor, Hit the following command.

    # sudo nano /etc/redis/redis.conf
  2. Hit Ctrl+W Button and find the following line by hitting enter Button.

    # maxmemory 

          change it to 256mb or to the number you required.

# maxmemory 256mb

          

  1. Set the Password for Radis. Hit Ctrl+W and type “# requirepass” and Hit Enter.

     requirepass Your Password
    


  2. Change it to your desired Password.

  3. Type CTRL+X and press Y Button and Hit the Enter key to save the configuration.

  4. Restart the Redis Service to update the configuration we have made in redis.conf file.

    # rsudo service redis restart
    
  5. Check the Redis Status by executing the below command.

    # sudo service redis status
    

          This is it. You are done with Redis installation and configuration.

Related Articles

How to clean yum cache on CentOS?

We all know that YUM is an open-source command-line package. When a package is downloaded,...

How to disable anonymous ftp in cpnael?

Note : It is not recommended to use anonymous FTP. It allows any person to access FTP without...

How to install Magento 2.x.x in cPanel?

System Requirement :   Operating System: Centos, Debian, Ubuntu, RHCE RAM: 2 GB (Require for...

How to Enable Root User in Ubuntu Server?

Please refer to the below steps to enable root user in ubuntu. Login to your ubuntu server...

How to use chmod to change file permission?

In this article, we will describe how to use the chmod command to modify file permission in Linux...

  • 0 Users Found This Useful

Was this answer helpful?