Redis is a popular in-memory database used world wide. Many developers use Redis in their projects; therefore, it's worthwhile to learn it. In this article, we will learn how to install Redis using Docker Compose. I chose Docker Compose because the installation is very easy and work across various multiple operating systems.
docker-compose.yml
version: '3.8'
services:
redis:
image: redis:7.2-alpine
container_name: redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
restart: unless-stopped
volumes:
redis-data:
In your terminal, we can input the command below:
docker-compose up -d
This will pull Redis image (if not already available), create the container, and start in the background.
You can connect to Redis CLI:
docker exec -it redis redis-cli
Created with ❤️ using Next.js & Tailwind CSS