Installation and Starting the Servers of Redis Stack using Docker
Last Updated :
16 Oct, 2024
Redis Stack is a bundle of the best technology that Redis is offering in one place, in an easy-to-use package. Starting the Redis stack will start the servers of different technologies that Redis is offering under the Redis Stack. Redis Stack Server extends the core features of Redis OSS, providing a complete developer experience.
Technologies Redis offers under the Redis stack
- RedisJSON (rejson): A module for Redis allowing you to manage JSON documents.
- RediSearch (redisearch): A Redis module that acts as a full-text search engine.
- RedisBloom (redisbloom): A Redis module that provides a scalable bloom filter.
- RedisTimeSeries (redistimeseries): A Redis module intended for storing time series data.
- RedisGears (redisgears): A distributed, fault-tolerant framework for building Redis applications that handle data in real time.
What is Redis?
Redis is an open-source in-memory data store that functions as a database, cache, and message broker. It is extremely fast because it saves data in memory and supports an extensive variety of data types, including strings, lists, sets, and hashes. Redis's reputation for simplicity, high performance, and versatility contributes to it being an attractive option for applications that need real-time analytics and quick data access.
What is the Redis Docker official image?
Redis is similar to a simultaneous-taskthat, lightning-fast digital storage device. It can handle multiple information forms, including text, lists, and more, and maintains data in memory making it blazingly fast. It is an excellent choice for apps that need to access and analyze data rapidly and in real-time because it is simple to use.
Running Redis Stack Locally with Docker | Step-by-Step Guide
Here are the steps to run Redis Stack on Docker.
Step 1: Install Docker from the official website.
Step 2: Update the Windows subsystem of Linux if there is a version issue with the kernel using the following command in the terminal.
wsl -update
Step 3: Run on the Redis stack server on Docker by selecting the Docker Image:
- Redis/Redis-stack contains both the Redis Stack server and Redis Insight. This container is good for local development because we can use the embedded Redis Insight to visualize our data.
- redis/redis-stack-server provides Redis Stack server only. This container is the best option for production deployment.
Step 4: Open the terminal and check whether Docker is installed or not using command.
docker --version
After running this command, it will show the docker version in the terminal like below.

Step 5: Start the docker by clicking it from the downloads.

Pull the Redis image
Step 6: To pull the Redis image from Docker Hub, use the following command:
docker pull redis/redis-stack-server
Run the Redis container
Step 7: Redis-stack command to run the redis on docker.
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
docker run
: To start creating a new Docker container, use this command.-d
: When enabling this flag, Docker gets told to execute the container in detached mode, which involves running the container in the background and displaying its unique identifier.--name redis-stack
: You may give the container a unique name through this option. The container in this instance will be named redis-stack.-p 6379:6379
: This option connects the host's port 6379 with the container's port 6379. Redis utilizes port 6379 by default for client connections.-p 8001:8001
: This option connects the host's port 8001 to the container's port 8001. RedisInsight, a graphical user interface for Redis, typically utilizes port 8001.redis/redis-stack:latest
: This tells us which Docker image is to be used to build the container. The image in this particular case is redis/redis-stack, and the tag is the latest. If the image is not already available locally, Docker will search for it from the Docker Hub repository.
Starting redis-stack starts the redis Insight also at port 8001 and redis-stack-server starts without redisInsights at port 6379. To change the ports where they are getting exposed change the value on the left part after -p.
Verify that the Redis container is running
Step 8: The redis-stack-server starts running which can be seen in the below image along with the port and status.

Refer the below image the redis container running on the linux along with the port.
docker ps
- docker: This is the Docker CLI (Command Line Interface) command-line tool used to interact with Docker.
- ps: This is a subcommand of the Docker CLI, short for "process status". It's borrowed from the Unix/Linux
ps
command, which is used to list running processes.
Connect to your database
Step 9: Run this command to connect to the server using redis-cli
docker exec -it redis-stack-server redis-cli
- docker: This is the command-line interface (CLI) tool for Docker, which is used to interact with Docker containers and manage Docker resources.
- exec: This is a subcommand of the
docker
CLI, used to execute a command inside a running container. - -it: These are two options passed to the
docker exec
command:-i
(or --interactive
): Keeps STDIN open even if not attached, allowing interaction with the command being executed.-t
(or --tty
): Allocates a pseudo-TTY (Terminal) for the command being executed, enabling terminal interaction.
- redis-stack-server: This is the name of the Docker container where the command will be executed. In this case, it refers to the Redis container named
redis-stack-server
. - redis-cli: This is the command to be executed inside the Docker container. Specifically, it launches the Redis command-line interface (CLI), allowing the user to interact with the Redis server running inside the container.
Testing Redis container
Step 10: Test the redis using the below command.
ping
Now check the modules present by using the below command.
MODULE LIST
After running the above command, we can see the Module Lists in terminal. List the modules on redis.

List the modules in redis on linux using the below command. Refer the below image for better understanding.
Operations on Redis Cache using Redis-cli:
- SET: SET key value
- GET: GET key

Operations on redis-bloom using redis-cli:
- INSERT: BF.ADD filter_name value
- EXISTS: BF.EXISTS filter_name value

Running Redis Container with Persistent Storage
Step 11: Run the Redis container with the volume mounted for persistent storage:
docker run -d --name my_redis_container -v redis_data:/data redis
-d
: Runs the container in detached mode (in the background).--name my_redis_container
: Specifies a name for the container.-v redis_data:/data
: Mounts the Docker volume redis_data
to the directory /data
inside the container. This is where Redis stores its data by default.redis
: Specifies the Redis image to use.
Redis Stack with Docker Compose
Create a docker-compose.yml
file defining Redis services along with Redis Insight (optional) using Docker Compose syntax.
version: '3.8'
services:
redis:
image: redis/redis-stack:latest
ports:
- "6379:6379"
- "8001:8001"
Run the redis using the docker compose using the below command.
docker-compose up -d
Redis Stack vs Redis
Aspect | Redis Stack | Redis |
---|
Components | Includes core Redis server along with additional technologies such as RedisJSON, RediSearch, RedisBloom, RedisTimeSeries, and RedisGears. | Refers specifically to the core Redis server. |
Features | Provides a comprehensive set of features and functionalities for various use cases, including data storage, search, analytics, and real-time data processing. | Offers fast, in-memory data storage with support for various data types and a rich set of commands for data manipulation and retrieval. |
Management Tools | May include management and visualization tools like RedisInsight for easier monitoring and administration of Redis instances. | Does not include additional management or visualization tools by default. |
Use Cases | Suitable for applications requiring advanced features and functionalities beyond basic key-value data storage, such as real-time analytics, search, and complex data processing. | Widely used in applications requiring fast and efficient key-value data storage, caching, session storage, and message brokering. |
Deployment | Can be deployed standalone or as part of a larger stack, depending on the requirements of the application. | Can be deployed standalone or integrated with other technologies as needed. |
Community Support | Supported by the Redis community and maintained by Redis Labs. | Supported by the Redis community and maintained by Redis Labs. |
Conclusion
Deploying Redis Stack on Docker streamlines local development by bundling Redis technologies like RedisJSON, RediSearch, RedisBloom, RedisTimeSeries, and RedisGears. With Redis Insight, developers gain a comprehensive toolset for visualization and management. Docker's flexibility enables easy containerization and scaling for both development and production environments. Leveraging Redis Stack facilitates efficient caching, full-text search, bloom filters, time-series data storage, and real-time data processing. Persistent storage options ensure data durability, enhancing reliability across container restarts.
Similar Reads
Docker Installation in Linux With its Required Packages Using GPG Key
Pre-requisite: Docker In this article, we are going to install docker using the GPG key, but why use GPG? because we don't want to install unauthenticated packages to our Linux machine and risk our Linux machine and also to make sure users can communicate securely. GPG, or GNU Privacy Guard, is a pu
2 min read
How To Use Docker for Gaming Servers with SteamCMD?
Pre-requisite: Docker Docker is an open-source software that is used to containerize applications. Containerization makes the deployment of applications easy. Today we will deploy a SteamCMD game server using docker. Deploying game servers using docker will make it easy to deploy our game servers on
9 min read
How To Install Docker Using Ansible Playbook ?
Docker is a software platform that allows you to build, test and deploy applications that use OS-Level virtualization to deliver software in packages called "containers". Containers - Docker package software into standardized units called "Containers". Docker is a stand-alone tool. which means no ne
7 min read
Docker - Installation on Windows
In this article, we are going to see how to install Docker on Windows. On windows if you are not using operating system Windows 10 Pro then you will have to install our docker toolbox and here docker will be running inside a virtual machine and then we will interact with docker with a docker client
2 min read
Install Docker Engine On CentOS Using AWS EC2 Instance
The Docker Engine facilitates efficient containerization and helps optimize the deployment and management processes. CentOS and Redhat are enterprise-based Linux distributions. Working on this using containerization technology enhances productivity by containerizing your applications and managing th
7 min read
Linux Post-Installation Steps for Docker Engine
When it comes to containerization Docker is the go to choice allowing developers and system admins to bundle applications and their requirements into containers. After setting up Docker Engine on your Linux setup it's essential to carry out installation tasks to make the most of its capabilities. Le
6 min read
How to Run a Python Script using Docker?
Docker helps you to run your Python application very smoothly in different environments without worrying about underlying platforms. Once you build an image using dockerfile you can run that image wherever you want to run. Docker image will help you to package all the dependencies required for the a
8 min read
How To Install and Use Docker on Ubuntu 22.04
Docker is a platform used by developers to automate the deployment of applications within containers. The containers include all the necessary components for the application to run, ensuring consistent behavior across various environments. In this guide, we'll walk through the process of installing
4 min read
How to Use Docker Images For Scaling Applications?
Docker image is a lightweight piece of software that includes everything that your application needs to run, it includes code, software packages, and libraries. Docker images are built using a Docker file which includes the instruction for creating the image. The Docker image is built on top of a ba
4 min read
Spring Boot - CRUD Operations Using Redis Database
Redis is an in-memory data structure that is used for faster access to data. It is used to store data that needs to be accessed frequently and fast. It is not used for storing large amounts of data. If you want to store and retrieve large amounts of data you need to use a traditional database such a
8 min read