Redis: RedisInsight Installation on Ubuntu 20.04 & Redis Stack Server Docker Container Set Up
Tags: redis, tutorial, devops, linux
Published: 2022-09-27 02:27:43

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](https://redis.com/redis-enterprise/redis-insight/?_ga=2.27386684.1601466670.1663444537-363929299.1661713844)**  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](https://docs.docker.com/engine/install/ubuntu/)**  installed and functioning correctly on your PC.

You can read up on the Redis Stack Server documentation **[here](https://redis.io/docs/stack/get-started/install/docker/)**.



##### 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
```

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
```
If your container is not running use this command to start your container.

```
$ docker container start redis-stack-server
```
Once your redis-stack-server is up and running. SSH into your redis-stack-server container.

```
$ sudo docker exec -it redis-stack-server sh
```
To test whether the Redis server is functioning correctly inside the container use the client command-line to ping the Redis server.

```
# redis-cli
```

```
127.0.0.1:6379> ping
```
Output

```
PONG
```
Click **[here](https://redis.com/redis-enterprise/redis-insight/#insight-form)** 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>
```
***Your file name should be the same as the one you downloaded***.

##### E.g

```
$ sudo chmod +x RedisInsight-v2-linux-x86_64.AppImage
```
You can double-click on the file or use this command to start your RedisInsight.

```
./RedisInsight-v2-linux-x86_64.AppImage
```
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](https://drive.google.com/uc?export=view&id=1hkuu8bQit4Edt-3OVsOyK87n_Kp2FSm0)

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

***This post is in collaboration with [Redis](https://redis.io/)***



##### Related

**[Try Redis Cloud for free](https://redis.com/try-free/?utm_campaign=write_for_redis)**

**[Redis Developer Hub - tools, guides, and tutorials about Redis](https://redis.info/3LC4GqB)** 

**[RedisInsight Desktop GUI](https://redis.info/3wMR7PR)** 



**[Watch this video on the benefits of Redis Cloud over other Redis providers](https://redis.info/3Ga9YII)**

<video src="https://drive.google.com/uc?export=view&id=1GFqYQ2OROZ-aMrUS0mWwopunVgV-oD4J"></video>