Aim

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams.

In this post we will be installing Redis and Redis Insight (GUI) using docker-compose

Prerequisite

  • Docker must be installed on your machine.
  • Docker compose must be installed on your machine.

Create a docker compose file

touch redis-docker-compose.yml
  • Put the below contents in the file
  • Redis is exposed at port 6379 and the persistent data will be stored in redis_volume_data
  • Redis Insight is exposed at port 8001 and the persistent data will be stored in redis_insight_volume_data
version: "3.3"
services:
  redis:
    image: redis:6.0.7
    container_name: redis
    restart: always
    volumes:
      - redis_volume_data:/data
    ports:
      - 6379:6379
  redis_insight:
    image: redislabs/redisinsight:latest
    container_name: redis_insight
    restart: always
    ports:
      - 8001:8001
    volumes:
      - redis_insight_volume_data:/db
volumes:
  redis_volume_data:
  redis_insight_volume_data:

This will start two docker services

  1. Redis Database : This is the actual Redis database server
  2. Redis Insight : This is the Redis Dashboard. A Graphical User Interface

Starting the services

  • You can start the service in foreground mode
docker-compose -f redis-docker-compose.yml up
  • If you want you can start the services in background mode using
docker-compose -f redis-docker-compose.yml up -d

Access the Redis Graphical User Interface

  • You can access the Redis Insight using http://192.168.0.10:8001
  • You need to accept their privacy settings
  • Then click on Add Redis Database and select Add Database

add redis database

  • It will take you to another screen

add redis database details

You need to enter following data and leave other things as blank

  1. Name : Give a meaningful name
  2. Host : Provide the IP Address of the machine where you installed redis using docker compose
  3. PORT : Provide the port as 6379
  • Click on Add Redis Database and then click on the Card where the name given in above step appears.
  • You will be taken to Redis dashboard. You can see all the data related to Redis in that dashboard.

redis dashboard

Happy Coding

5 2 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x