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.
Docker Install Redis
1. Pull Image
Download the official Redis image from Docker Hub. sudo docker pull redis Verify the download with:
sudo docker images2. Start Redis
Create a configuration directory and file.
sudo mkdir -p /mydata/redis/conf
sudo touch /mydata/redis/conf/redis.confRun 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.conf3. Connect to Redis
sudo docker exec -it redis redis-cli4. Test Redis
Set a key and retrieve it.
set a 100 get a5. Enable Persistence
Edit the mapped redis.conf and add appendonly yes.
sudo vim /mydata/redis/conf/redis.conf
appendonly yesRestart 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 a6. Install Redis Visual Management Tool
Install Redis Desktop Manager and connect to the running Redis instance.
View the Redis databases through the GUI.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
