RedisInsight Docker image

2 minute read

Introduction (Approx. 100 words) RedisInsight is an advanced tool designed for efficient management and visualization of Redis data. It is ideal for both development and production environments. This guide will walk you through setting up a Docker environment for RedisInsight, offering a reliable and isolated platform for Redis data management.

Prerequisites (Approx. 100 words) Before beginning, ensure Docker is installed on your system. A basic understanding of Docker, Redis, and command-line operations is beneficial. This preparation paves the way for a seamless installation and configuration process of RedisInsight within a Docker container.

Step-by-Step Instructions (Approx. 600 words) Install nvm and Node.js Node Version Manager (nvm) is a tool that facilitates the management of multiple Node.js versions. To install nvm, use the command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

After installation, verify nvm is installed by running:

command -v nvm

Next, find the latest Long-Term Support (LTS) version of Node.js using:

nvm ls-remote --lts

Install Node.js version 18.18.2:


nvm install v18.18.2
nvm use v18.18.2

Finally, check the installed Node.js versions:


nvm ls

Clone RedisInsight Repository To set up RedisInsight, start by cloning its repository:


git clone https://github.com/RedisInsight/RedisInsight.git
git checkout -b branch/2.36.0 2.36.0
git branch --list

Cloning the repository is essential for accessing the RedisInsight code and Dockerfile necessary for the Docker build.

Install Yarn and Prepare RedisInsight Project Yarn is a package manager that excels in speed and consistency. Install it globally:


npm install --global yarn
yarn --version

The version should be 1.22.19 or newer.

To prepare the RedisInsight project, execute:


yarn install && yarn --cwd redisinsight/api/
yarn build:statics
npx update-browserslist-db@latest

These commands install dependencies, build static files, and update the browser list database.

Local Development Setup For local development, you need to run both backend API and frontend services. Start the backend API:


yarn --cwd redisinsight/api/ start:dev

For the frontend, use:


yarn start:web

This setup allows for real-time development and testing of RedisInsight on your local machine.

Building Docker Image Building a Docker image for RedisInsight encapsulates the application in a container, offering a consistent environment. Use the following command:


docker build -t lukechi1219/redisinsight:2.36.0 .

Replace lukechi1219 with your Docker Hub username.

Creating and Using a Docker Compose File (Approx. 400 words) Docker Compose is a tool for defining and running multi-container Docker applications. Create a docker-compose.yaml file with the following content:


version: "3.9"
services:
  redisinsight:
    container_name: RedisInsight-2.36.0
    restart: unless-stopped
    image: lukechi1219/redisinsight:2.36.0
    ports:
      - 5000:5000
    volumes:
      - ~/RedisInsight/.redisinsight-v2:/root/.redisinsight-v2

This configuration sets up a RedisInsight service, specifying the container name, restart policy, image to use, port mapping, and volume for data persistence. The docker-compose.yaml file simplifies the process of starting and managing the RedisInsight container.

Starting the Docker Container (Approx. 100 words) To start the RedisInsight Docker container, navigate to the directory containing your docker-compose.yaml file and run:


docker-compose up -d

This command starts the RedisInsight container in detached mode. You can now access RedisInsight through your browser at http://localhost:5000.

Troubleshooting and Common Issues (Approx. 300 words) Address common issues that users might encounter during installation, such as problems with Docker permissions, network issues, or errors in RedisInsight setup. Provide solutions and tips for troubleshooting.

Conclusion (Approx. 100 words) This guide has walked you through setting up a Docker environment for RedisInsight. By following these steps, you now have a robust and isolated platform for managing and visualizing your Redis data.

Additional Resources (Approx. 100 words) Include links to further resources on Docker, RedisInsight, and Node.js for readers interested in expanding their knowledge or troubleshooting specific issues.

Updated: