cloudharp.org
  • Home
  • Privacy Policy
  • Contact Us
  • Guest Post – Write For Us
  • Sitemap
cloudharp.org

How to Install Redis on Ubuntu 20.04/22.04

  • Jeffery Williams
  • April 1, 2022
Total
0
Shares
0
0
0

Redis is a popular open source, in-memory data structure store that competes with other databases such as SQLite and MySQL. It’s often used to speed up web application response time by caching pages or content generated from user interactions on websites or applications. In this tutorial, we will install Redis on Ubuntu 18.04 LTS and monitor the installation process using the built-in command line tool ‘redis-server’.

What’s the big deal about Redis? Redis has established a reputation as a go-to data storage. It’s a key-value, in-memory, and open-source data store. Redis is an excellent message broker, cache, and database candidate/application because of these characteristics.

Redis’ résumé also shows that it supports a variety of data structures, including Sets, Hashes, Lists, and Strings. Multiple Redis nodes and Redis Cluster enable excellent Redis availability thanks to features like automated partitioning and Redis Sentinel.

Prerequisite

On the Ubuntu operating system, you must be a sudoer/root user.

Redis installation on Ubuntu

Ensure that your Ubuntu operating system is up to date, since this aids in the performance optimization of both installed and uninstalled application packages.

$ sudo apt update && sudo apt upgrade -y

Then, to install Redis on your Ubuntu machine, use the command below.

$ sudo apt install redis-server -y Install Redis in UbuntuInstall Redis in Ubuntu

Once the installation is complete, check the version of Redis that is installed on your machine.

$ redis-server –version Check Redis Version in UbuntuCheck Redis Version in Ubuntu

Then, make sure Redis is up and running by enabling it and checking its status.

$ sudo systemctl enable redis-server $ sudo systemctl status redis-server Check Redis Status in UbuntuCheck Redis Status in Ubuntu

Setting up Redis on Ubuntu

After we’ve installed Redis and verified that it’s up and running, we’ll need to make some crucial configuration changes. Redis’ default installation does not allow for remote connections. On the system hosting Redis, the default setup only allows connections from localhost (127.0.0.1).

If you just have one server, you don’t need to allow remote access/connection in your Redis settings. If you need to run Redis on a separate/remote server for whatever reason, you’ll need to configure it to support remote connections.

On your Ubuntu machine, use the following command to access Redis’ primary configuration file:

/etc/redis/redis.conf sudo nano

On the file, trace the following sections:

Configuration File for RedisConfiguration File for Redis

This section explains how to bind Redis to the IP addresses of all or specified remote computers. For example, if we want any remote user to be able to connect to this Redis server, we may comment out or remove the line bind 127.0.0.1::1 and replace it with bind 0.0.0.0::1.

Redis Remote Connection should be enabled.Redis Remote Connection should be enabled.

Restart the Redis server for the new configuration modifications to take effect.

sudo systemctl redis-server restart

Next, make sure that all of Redis’ interfaces are listening.

$ ss -an | grep 6379 Check Redis Listening StateCheck Redis Listening State

Because Redis communicates on port 6379, your firewall should be set to allow traffic over this port if it is enabled.

ufw allow 6379/tcp $ sudo ufw allow 6379/tcp ufw reload $ sudo ufw status $ sudo

Redis Remote Connection is being tested.

Install redis-tools on the remote workstation that wants to connect to the Redis server to make client-server communication easier.

apt install redis-tools -y $ sudo apt install redis-tools -y

The redis-cli program will now be used to ping the Redis server via IP address.

$ redis-cli -h 192.168.100.23 ping Test Redis Remote ConnectionTest Redis Remote Connection

The PONG result indicates that the two distant computers are able to connect with one another.

The installation, setup, and testing of the Redis server on Ubuntu were covered in this post. Refer to the file /etc/redis/redis.conf for a more detailed Redis setup tutorial.

Total
0
Shares
Share 0
Tweet 0
Pin it 0
Jeffery Williams

Previous Article

Gran Turismo 7 is proof of why Xbox Series X is better than PS5

  • Jeffery Williams
  • March 27, 2022
View Post
Next Article

Bank of Spain believes that those who invest in Bitcoin are unaware of its risks

  • Jeffery Williams
  • April 2, 2022
View Post
Table of Contents
    1. Prerequisite
  1. Redis installation on Ubuntu
  2. Setting up Redis on Ubuntu
  3. Redis Remote Connection is being tested.
Featured
  • 1
    Live Grades for Quay Walker and Every Other Green Bay Packers Pick
    • April 29, 2022
  • 2
    Sony Releases New FE 24-70mm F2.8 GM II Lens
    • April 29, 2022
  • 3
    Core Keeper: How to Get Slime Oil
    • April 28, 2022
  • 4
    Fix Browser error code b5 in Respondus LockDown [Instructors & Students]
    • April 26, 2022
  • 5
    Best 9 Sleek Desk Chairs In 2022
    • April 26, 2022
Must Read
  • 1
    How to Kill American Infrastructure on the Sly
  • 2
    Download Lyric Pad. for PC Windows 10,8,7
  • 3
    Who’s leading for Hart, Norris, Vezina, Selke, Calder?
cloudharp.org
  • Home
  • Privacy Policy
  • Contact Us
  • Guest Post – Write For Us
  • Sitemap
Stay Updated Always.

Input your search keywords and press Enter.