Install Redis using docker and docker compose | Redis Insight docker installation

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello people this is self turds and in this video we'll learn that how we can install redis using Docker compose so redis is an in-memory database which is used for caching purpose and it is very widely used in large scale applications so let's learn how we can install redis using Docker compose if you go by the traditional method of installation then that can create issues related to your operating system so Docker plays an important role where its operating system agnostic and you can install anything whatever you want So before installing the redis on Docker we we need some prerequisitives to be fulfilled so first thing is what Docker must be installed on your operating system and Docker compost should also be installed on your operating system so without these you can't install redis using Docker or Docker compose so these are the two things that is needed if you go to my website that is self-dets.in so here you will see that I have already created a post on how to install Docker on Ubuntu 222. X if you go to my Docker for beginner series then there you will find a video on how to install Docker on Windows Mac or Linux so you can follow this video and install Docker on any operating system you can go to my another blog post that is installed redis using Docker compose and this is the set of instruction that will be following for our installation you need to create the docker compose file and inside the docker compose file you need to put below contents so you must be familiar with the docker compose file so these are the two services that we are creating first is redis and second is the redis inside so redis is the actual server and redis insight is the graphical user interface which can be used to view the data inside radius what is happening with the redis instance so if you see here we have used the image version as 6.0.7 the container name will be redis will always restart it there is a volume volume is there to basically store the data so what we are saying that the data inside the redis container that will be be created will be mapped to the redis volume data on your host machine so that even if you restart the ready server or you kill the container you create new container then your data will be saved that it it will not be lost so it is like persistent of your data the port that will be exposed is 6379 and here also inside the docker container it will be 6379 so if you understand the support part there is a host operating system and there is this Docker so you create the redis container inside it but this will not be accessible outside of this Docker environment because it is isolated from the host environment so we need to do something called as port forwarding and basically using this port forwarding if someone calls this 6379 port on the host operating system then the data will be relayed back to the 6379 port on the docker container so you can change this Docker Port I have already created a video on Docker port on my Docker for business you can follow that also for better understanding so what we are doing in our yaml configuration is the 6379 Port is on the host n6379 port on the right hand side is inside the redis container the radius inside is another image from which we'll be creating a container and it will be exposed on the port 8001 let's copy this EML configuration of our Docker compose so I'll copy it and let's paste it here in my ID which I'm using I am inside this folder YouTube playground I will create a new yaml file I'll right click here go to new and just say file and I'll say redis Docker compose and that extension will be yaml so I'll just paste it here and you see that this ID identifies the ml configuration and it basically beautifies it let's go to our terminal and if I do LS here then Rod ready Docker compose is already present here let's see if the prerequisitives are fulfilled or not so I hit Docker and you can see that Docker is installed if I hit Docker compose then you can see that Docker compose is also installed so whenever you want to run the docker compose file so what you need to do you need to do Docker compose hyphen f and then the docker compose file name here it is ready stalker compost.tml and you need to do up up means to start the services so if I hit enter what it is going to do it is going to create the container so if the images are not present on your local machine first it will download the images and then basically it will create the containers out of it I'll open a new terminal here or I can just split this terminal and I I'll say Docker PS so you can see the these are the two containers that are actively running on my system so let's go to our Chrome browser and there will check that what is this radius inside and can we connect to this ready server or not in the Chrome browser let's see the redis inside container so I'll say localhost and the port we know is 8001 which we saw in the configuration now I already have a database I don't have a Reddit credits database so since we have already created the container so I'll say I have I am already having the database and then what we need to do we need to use this connect to reduce data radius database using hostname and Port so the hostname will be what it will be localhost so I'll say localhost Port a6379 so I'll write six three seven nine the name will be I can say redis local and then the username and password since we are not doing any authentication so I'll just say add radius database so it is saying could not connect error 99 let's see our configuration okay so the name of this container is redis and inside the this radius inside is also deployed within the same ecosystem so let's try to refer this container using this hostname like redis so let's go to the Chrome browser here let's go to this one let's see if it works or not so if I do redis and then if I do address it add radius database so it is working so this is my radius local and if you can see here then we will see that okay 846 KB is the total memory there is one connected client I can also use the CLI so it is saying pinging ready server as 6379 I'll say key star so you can see it is empty list so let me set something set name equal to code with Raj ranjan that is my name and if I do get name so it will give me code with Raj engine so you can see here this is the radius inside you don't need to connect using that CLI tool or ready CLI tool you just need to install this radius inside using the docker compost so this is the configuration so this is how we can install redis using uh the docker compose file so hope you like this video hope you like my Channel please share these videos with other people and please subscribe to my channel thank you
Info
Channel: CodeWithRajRanjan
Views: 21,364
Rating: undefined out of 5
Keywords: docker, docker-compose, redis, redis insight, redis docker installation, how to install redis using docker compose, redis docker compose
Id: qucL1F2YEKE
Channel Id: undefined
Length: 7min 9sec (429 seconds)
Published: Wed May 10 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.