Databases 4 min read

How to Install and Configure Redis Using Docker

This tutorial walks through pulling the Redis Docker image, creating configuration files, running the container, connecting with redis-cli, testing commands, enabling persistence, and installing a visual management tool, providing complete step‑by‑step instructions for Docker‑based Redis deployment.

Wukong Talks Architecture
Wukong Talks Architecture
Wukong Talks Architecture
How to Install and Configure Redis Using Docker

Docker Install Redis

1. Pull Image

Download the official Redis image from Docker Hub. sudo docker pull redis Verify the download with:

sudo docker images

2. Start Redis

Create a configuration directory and file.

sudo mkdir -p /mydata/redis/conf
sudo touch /mydata/redis/conf/redis.conf

Run the Redis container with port mapping and volume mounts for data and configuration.

sudo docker run -p 6379:6379 --name redis \
  -v /mydata/redis/data:/data \
  -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf \
  -d redis redis-server /etc/redis/redis.conf

3. Connect to Redis

sudo docker exec -it redis redis-cli

4. Test Redis

Set a key and retrieve it.

set a 100
get a

5. Enable Persistence

Edit the mapped redis.conf and add appendonly yes.

sudo vim /mydata/redis/conf/redis.conf
appendonly yes

Restart the container and verify persistence.

docker restart redis
set a 200
get a
sudo docker restart redis
sudo docker exec -it redis redis-cli
get a

6. Install Redis Visual Management Tool

Install Redis Desktop Manager and connect to the running Redis instance.

View the Redis databases through the GUI.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DockerdatabaseredisConfigurationLinuxInstallation
Wukong Talks Architecture
Written by

Wukong Talks Architecture

Explaining distributed systems and architecture through stories. Author of the "JVM Performance Tuning in Practice" column, open-source author of "Spring Cloud in Practice PassJava", and independently developed a PMP practice quiz mini-program.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.