Skip to content

How to installation Redis Cache with docker ?

How to installation Redis Cache with docker compose? for using docker, you need to install docker desktop in your local computer See installation. Next successfully install docker, please create file docker compose with name docker-compose.yaml Docker compose file

update it with following content:

version: '3.9'
services:
  redis:
    image: redis:latest          # name of image source (https://hub.docker.com/_/redis)
    container_name: redisCache   # name of container 
    restart: always              # always restart
    ports:
      - 6379:6379                # host port 6379 is mapper to docker port 6379
    volumes:
      - redis_volume_data:/data
volumes:
  redis_volume_data:

next steep running docker compose, please use following command:

    docker-compose up -d

check your docker container status in docker desktop: Check Docker container status

Check And Running Redis Cache

Open docker desktop, click setting and click Open in terminal click Open in terminal View terminal container, and run command redis-cli run redis in terminal

Congratulation, redis is installed and ready to use.