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
- Docker must be installed on your machine.
- Docker compose must be installed on your machine.
Create a docker compose file
- 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
- Redis Database : This is the actual Redis database server
- 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
- It will take you to another screen
You need to enter following data and leave other things as blank
- Name : Give a meaningful name
- Host : Provide the IP Address of the machine where you installed redis using docker compose
- 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.