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.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How to check Various cPanel logs like WHM, Apache, MySQL, Email, Error etc?

You can use cPanel to access your Linux hosting account with GUI. It is relatively easier to work...

How To install Nginx on CentOS 7?

Nginx is a Web server that can be installed on Linux Server. You may have heard about Apache Web...

How to Protect GRUB with Password in Linux ?

GRUB called as Grand Unified Bootloader is a default Boot loader on Unix OS. In a Linux system,...

How to Deploy Laravel Application with Nginx on Ubuntu?

Laravel is a PHP Framework and Nginx is a Web-Browser which can be installed on Ubuntu. Nginx is...

How to install Dotnet Core on Centos 7 ?

Dotnet Core is now available with the Linux OS. Following are the steps to install Dotnet Core on...