How to Setup Redis Using Docker Desktop on macOS
- Chandan Rajpurohit
- May 20
- 3 min read
Redis is one of the most popular in-memory databases used for caching, real-time analytics, session storage, and message brokering. If you're using macOS, the easiest and cleanest way to run Redis locally is with Docker Desktop.

Today, in this step-by-step guide, you'll learn how to:
Install Docker Desktop on macOS
Run Redis in a Docker container
Connect to Redis
Test your Redis setup
Stop and restart Redis containers
This tutorial is optimized for beginners, developers, and DevOps engineers looking for a simple Redis local development setup on Mac.
Why Use Redis with Docker on macOS?
Using Docker Desktop to run Redis offers several advantages:
No manual Redis installation
Easy cleanup and upgrades
Isolated environment
Consistent setup across teams
Fast local development
Whether you're building Node.js, Python, Java, or Go applications, Dockerized Redis makes development easier.
Install Docker Desktop on macOS

Visit the official Docker website:
Download the correct version for your Mac:
Apple Silicon (M1/M2/M3/M4)
Intel chip
After downloading:
Open the .dmg file
Drag Docker into Applications
Launch Docker Desktop
Wait until Docker starts successfully
Verify Docker installation:
docker --versionPull the Redis Docker Image
Docker images are templates used to create containers. You can pull the redis docker image using the docker command or Docker Desktop
Run this command:
docker pull redis In Docker Desktop
Go to Search in Docker Desktop
Search for redis
In Images, click on Pull

Once the image is pulled you should be able to see the redis image in Images.

Run Redis Container on macOS
Now start Redis using Docker.
Run this command:
docker run --name redis-local -d -p 6379:6379 redisCommand Breakdown
Option | Meaning |
--name redis-local | Container name |
-d | Run in background |
-p 6379:6379 | Expose Redis port |
redis | Redis image |
In Docker Desktop
In Images, go to Actions
Click on run icon
You should get a pop up for Run a new container
Add container name as redis_local and port as 6379
Finally, click on run button

Verify Redis Container is Running
Run this command:
docker psIf there are no errors or issues, you should be able to see the redis_local conatiner successfully running.
In Docker Desktop
Go to Containers
Verify the running redis_local container

Connect to Redis Container
Now connect to the Redis CLI inside Docker.
In Docker Desktop
Click on Terminal (A terminal directly with Docker Desktop)
Run this command
docker exec -it redis-local redis-cliIf successful, you'll see:
127.0.0.1:6379>This means Redis is running correctly.
Test Redis Setup on macOS
Now let's test whether Redis works properly.

PING should reply with PONG. You can set a key using SET name_of_the_key "value" and you can get value using GET name_of_the_key
Exit Redis CLI
To exit Redis shell:
exitStop Redis Container
Stop Redis when not needed:
docker stop redis-localRestart Redis Container
Restart the same container:
docker start redis-localRemove Redis Container
If you want to completely delete Redis:
docker rm -f redis-localCommon Redis Docker Commands
Task | Command |
Pull Redis image | docker pull redis |
Run Redis | docker run -d -p 6379:6379 redis |
View containers | docker ps |
Stop Redis | docker stop redis-local |
Start Redis | docker start redis-local |
Access CLI | docker exec -it redis-local redis-cli |
Delete container | docker rm -f redis-local |
Setting up Redis using Docker Desktop on macOS is one of the fastest and most reliable ways to start local development.
With just a few Docker commands, you can:
Run Redis instantly
Test Redis using CLI
Persist data with volumes
Connect applications easily
Manage Redis containers efficiently
This approach is ideal for developers building scalable applications locally before deploying to production.
If you're working with microservices, APIs, caching layers, or real-time systems, Dockerized Redis is a must-have in your development workflow.
Frequently Asked Questions (FAQs)
Is Docker the best way to run Redis on macOS?
Yes. Docker provides the cleanest and easiest setup without modifying macOS system packages.
Does Redis persist data automatically?
Not always. Use Docker volumes for persistence.
Can I run multiple Redis containers?
Yes. Use different ports:
-p 6380:6379
-p 6381:6379Is Redis free to use?
Yes. Redis Community Edition is open source.
Thank you for reading this article, I really appreciate it. If you have any questions feel free to leave a comment.
Comments