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.