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.

Installation and Starting the Servers of Redis Stack using Docker

Redis Stack is a bundle of the best of the 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, and it provides a complete developer experience.

Similar Reads

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

Pull the Redis image

Step 6: To pull the Redis image from Docker Hub, use the following command:...

Run the Redis container

Step 7: Redis-stack command to run the redis on docker....

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

Connect to your database

Step 9: Run this command to connect to the server using redis-cli...

Testing Redis container

Step 10: Test the redis using the below command....

Running Redis container with Persistent Storage

Step 11: Run the Redis container with the volume mounted for persistent storage:...

Redis Stack with Docker Compose

Create a docker-compose.yml file defining Redis services along with Redis Insight (optional) using Docker Compose syntax....

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

Redis Stack using Docker – FAQs

How to start Redis server using Docker?...

Contact Us