top of page

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.


Redis

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


Download Docker Desktop

Visit the official Docker website:



Download the correct version for your Mac:

  • Apple Silicon (M1/M2/M3/M4)

  • Intel chip


After downloading:

  1. Open the .dmg file

  2. Drag Docker into Applications

  3. Launch Docker Desktop

  4. Wait until Docker starts successfully


Verify Docker installation:

docker --version

Pull 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

  1. Go to Search in Docker Desktop

  2. Search for redis

  3. In Images, click on Pull


Pull the Redis Docker Image

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


Redis Image

Run Redis Container on macOS


Now start Redis using Docker.


Run this command:

docker run --name redis-local -d -p 6379:6379 redis

Command Breakdown

Option

Meaning

--name redis-local

Container name

-d

Run in background

-p 6379:6379

Expose Redis port

redis

Redis image

In Docker Desktop

  1. In Images, go to Actions

  2. Click on run icon

  3. You should get a pop up for Run a new container

  4. Add container name as redis_local and port as 6379

  5. Finally, click on run button


Run a new container for redis image

Verify Redis Container is Running


Run this command:

docker ps

If there are no errors or issues, you should be able to see the redis_local conatiner successfully running.


In Docker Desktop

  1. Go to Containers

  2. Verify the running redis_local container


Redis Container

Connect to Redis Container


Now connect to the Redis CLI inside Docker.


In Docker Desktop

  1. Click on Terminal (A terminal directly with Docker Desktop)

  2. Run this command

docker exec -it redis-local redis-cli

If 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.


Test Redis

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:

exit

Stop Redis Container


Stop Redis when not needed:

docker stop redis-local

Restart Redis Container


Restart the same container:

docker start redis-local

Remove Redis Container


If you want to completely delete Redis:

docker rm -f redis-local

Common 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:6379

Is 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


Made with ❤️ by Chandan Rajpurohit

© 2026 by CR. 

  • LinkedIn
  • GitHub
bottom of page