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 INSTALL NEXTCLOUD ON UBUNTU?

Nextcloud is an open-source and secure PHP-based content collaboration platform. It is used for...

How to enable sFTP in a Linux VPS?

The SSH File Transfer Protocol (SFTP), also known as the Secure File Transfer Protocol, enables...

How to determine what is using the most disk space on a Linux server?

There are times when you receive following error while accessing the cPanel WebMail or WHM. You...

What if I exceed the bandwidth limit I am assigned with VPS?

Our system continually monitors the bandwidth usage of all our VPS. In case if your total monthly...

How to install Google Chrome on Ubuntu 18.04 using the Command Line?

Following are the steps to install Google Chrome using Command-Line. Edit the source.list file...