DEV Community

Tochukwu Adams
Tochukwu Adams

Posted on • Edited on

Redis: RedisInsight Installation on Ubuntu 20.04 & Redis Stack Server Docker Container Set Up

Redis is a key-value pair database that is extremely fast when compared to other traditional SQL databases such as PostgresSQl, MySQL or CockroachDB. This is as a result of its in-memory storage capacity. It is way ahead in the NoSQL sphere. It is a household name when it concerns database due to its flexibility and ease of use.

Redis can be applied to different scenarios, for instance:

  • Caching of data to increase throughput and reduce the query on the database.
  • Message Streaming in real-time. Redis supports Streaming Data Architecture where data are consumed immediately through the Publisher/Subscriber technique.
  • Real-time Analytics for retrieving, visualizing, and processing data with minimal delay.

Developers love Redis because is lightweight and open source with a very vibrant community. It supports most of the popular programming languages which include Python, JavaScript, Go, Java, PHP and many others. You can store and retreive data with a few lines of code and it has a lot of data structure for manipulating data. The most exciting feature of Redis is its in-memory store which reduces latency to milliseconds and reduce response time.

Redis works well on Linux, Windows and Mac OS but it works efficiently well with Linux base OS.

RedisInsight

RedisInsight is the Desktop GUI client that connects to your Redis Server to provide an interface for visualizing your Redis databases. The client enables you to use the RedisInsight GUI locally.

The essence of this tutorial is to set up RedisInsight on your PC and connect it to your Redis Stack Server docker container. Without further ado let's jump into setting up RedisInsight on our system.

Prerequisite

Before installing Redis using Docker you must have a root user privilege on your Linux operating system and the Docker Engine installed and functioning correctly on your PC.

You can read up on the Redis Stack Server documentation here.

Docker Image

Go to your terminal and install the Redis Stack Server docker image with the command below. I prefer using this stack because I can use it to manage both my local and remote Redis database.

$ sudo docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
Enter fullscreen mode Exit fullscreen mode

To test your redis-stack-server image downloaded successfully you need to interact with your redis-stack-server container shell.

Check if your container is up and running. The command below will list out your docker both running and non-running container.

$ docker ps -a
Enter fullscreen mode Exit fullscreen mode

If your container is not running use this command to start your container.

$ docker container start redis-stack-server
Enter fullscreen mode Exit fullscreen mode

Once your redis-stack-server is up and running. SSH into your redis-stack-server container.

$ sudo docker exec -it redis-stack-server sh
Enter fullscreen mode Exit fullscreen mode

To test whether the Redis server is functioning correctly inside the container use the client command-line to ping the Redis server.

# redis-cli
Enter fullscreen mode Exit fullscreen mode
127.0.0.1:6379> ping
Enter fullscreen mode Exit fullscreen mode

Output

PONG
Enter fullscreen mode Exit fullscreen mode

Click here to download the Redis GUI.

After downloading the RedisInsight client it automatically connects to your Redis Stack Server. Don't forget our Redis Stack Server is inside a docker container. To connect RedisInsigt to your Redis Stack Server docker container ensure your container is up and running. CD (change directory) into the folder where your downloaded RedisInsight file is stored and make it an executable file.

$ sudo chmod +x redisinsight-linux64-<version>
Enter fullscreen mode Exit fullscreen mode

Your file name should be the same as the one you downloaded.

E.g
$ sudo chmod +x RedisInsight-v2-linux-x86_64.AppImage
Enter fullscreen mode Exit fullscreen mode

You can double-click on the file or use this command to start your RedisInsight.

./RedisInsight-v2-linux-x86_64.AppImage
Enter fullscreen mode Exit fullscreen mode

An interface will be displayed that already has your local Redis database instances (if you have one).

Redis Cloud

To connect to your remote database on Redis Cloud. On the RedisInsight click on the Add Redis Database on the top left side of your screen. A form will display in the right corner for you to enter your Redis Cloud database details. Paste your public endpoint URL on the Host field on the form. It will automatically fill up the forms with your database credentials.

Hurray!!! we did it.

alt text

Drop your feedback and questions. I am in the comment section 😉

This post is in collaboration with Redis

Related

Try Redis Cloud for free

Redis Developer Hub - tools, guides, and tutorials about Redis

RedisInsight Desktop GUI

Watch this video on the benefits of Redis Cloud over other Redis providers

Top comments (0)