Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Running RedisInsight using Docker Compose

2 min read

RedisInsight is an intuitive and efficient GUI for Redis, allowing you to interact with your databases and manage your data—with built-in support for the most popular Redis modules. It runs on Windows, macOS, Linux and even can be run as a Docker container and Kubernetes Pods.

Last week, I came across the StackOverflow question around RedisInsight in Docker Compose and decided to come up with a blog post to talk detail around the solution.

Here’s a quick 5 minutes guide to help you get started with RedisInsight up and running using Compose file.

Step 1. Get Docker Desktop Ready

If you are on macOS, ensure that you install Docker Desktop on your system. Go to this link and choose “Download for Mac” for a quick installation.

Once you complete the installation, you should be able to verify by clicking “About Docker Desktop” on the whale icon.

You can verify it via CLI too:

 docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.9
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:13:00 2021
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:15:47 2021
  OS/Arch:          linux/amd64
  Experimental:     false
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
  Version:          0.19.0
  GitCommit:        de40ad0
ajeetraina@Ajeets-MacBook-Pro community % 

Step 2. Enable the File Sharing

Click “whale icon” appearing on the top bar, then select “Preference” under Docker Desktop > Select “Resources” > “File Sharing” and add the folder structure that you want to share. Please change the directory structure as per your environment

For this demonstration, I have add /data/redisinsight directory that I am planning to use in Docker Compose

Step 3. Create a Docker Compose file

We will be creating a compose file with 2 services – redis and redisinsight. Add the below content in Docker compose file and save it.

version: '3'
    image: redislabs/redismod
      - 6379:6379
    image: redislabs/redisinsight:latest
      - '8001:8001'
      - ./Users/ajeetraina/data/redisinsight:/db 

Ensure that you don’t have any running Redis instance on port 6379. If it is running, ensure that you change the port in the compose file to some other values like 6380.

Step 4. Execute the Compose CLI

docker-compose up -d
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating network "red_default" with the default driver
Creating red_redisinsight_1 ... done
Creating red_redis_1        ... done

Step 5. Verify if RedisInsight container is working or not

docker-compose ps
          Name                        Command               State           Ports         
pinegraph_redis_1          redis-server --loadmodule  ...   Up>6379/tcp
pinegraph_redisinsight_1   bash ./docker-entry.sh pyt ...   Up>8001/tcp

Step 6. Accessing RedisInsight

Open HTTP://IP:8001 to access RedisInsight UI

If you try to use “localhost” and try to add Redis database, there are chances that you might face the below error message.

Instead, use your host IP address as shown below:

ifconfig en0
	ether 3c:22:fb:86:c1:b1 
	inet6 fe80::1cf6:84b:4aca:36ad%en0 prefixlen 64 secured scopeid 0x6 
	inet6 2401:4900:16e5:3dcc:184d:e209:e4ae:2ddc prefixlen 64 autoconf secured 
	inet6 2401:4900:16e5:3dcc:5c08:6a0d:bff2:b87f prefixlen 64 autoconf temporary 
	inet netmask 0xffffff00 broadcast
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active

You should be able to connect to Redis database this time.

Further References:

Please follow and like us:

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Docker Captain, ARM Innovator & Docker Bangalore Community Leader.

Leave a Reply

Your email address will not be published. Required fields are marked *

© Copyright Collabnix Inc

Built for Collabnix Community, by Community