Running Redis Server Using Docker Container

The Coders Blog
Written by The Coders Blog on
Running Redis Server Using Docker Container

If you want to quickly test the Redis Server in you local environment then this guide is for you. There are other guides, if you want to set it up outside the docker.

If you are on Mac, you can simply install the Docker Desktop application. If you are on linux or window visit here to install it.

Installing the run the Redis container

docker run –name local-redis -p 6379:6379 -d redis

If you need to change the port, just change the port in the command

 <Port you want>: 6379

This command will pull the docker image for docker hub and and create a container. The container port is mapped with your local port as mention.

After completion of this command you can check if container is running using command below:

docker ps

Mostly you application can now interact with Redis server on mention port. No password is required.

Get into the container

If you want to ssh into the container following command can be used:

docker exec -it local-redis sh

You can stop or start the container as you need them in docker.

 

The Coders Blog

The Coders Blog

The blog is about ideas & thoughts learned, received & experienced about the coding, programming, problem-solving, software project management and anything undeniably interesting.

Comments

comments powered by Disqus