Install Docker on Ubuntu 22 04

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome back to yet another Linux tutorial in this video we are going to look at how to install Docker on Ubuntu containers which are isolated environments that contain everything that an application needs this includes the source code libraries dependencies Frameworks and configuration files now this ensures that applications run reliably and consistently regardless of the Computing environment now there are two ways of installing Docker on Ubuntu as well as install it from the official Docker repository so we're going to look at each of these methods starting with the first method which is installing Docker from the default repositories so to get started first of all ensure that your local upt cach is updated by running the command sudu apt update then hit enter so this should take a few seconds to complete all right we are done so we have updated the local package Index right so as you have said you can install Docker from the default repositories from the default IUN repositories and to do so simply run the command sudu apt install docker.io then pass the hyphen Y flag for non-interactive installation and hit enter so this is going to install Docker alongside all the dependencies uh required by Docker so just be patient as the installation proceeds so as you can see the installation is underway so here I'm going to go with the default so I'm going to hit enter and I'm going to hit enter as well all right so we are done with installing Docker so I'm going to clear the screen okay now let's see if docka is running so to do so we can run the command s sudu system CTL status Docker hit enter so as you can see we have doctor we have Docker active and running as expected okay we can also consider any enabling Docker to start on system uh startup or upon a reboot and to do so run the command sudu system C enable Docker and hit enter okay so we have enable Docker to start every time the system is powered on okay now another thing you can consider is to add the currently logged in user to the docker to the docker group and this allows you to run Docker without having to invoke sudu okay so to do so uh you need to add the currently logged in user to the docker Group by running the command sudo user mode hyphen a g then Docker group and then you're going to use the environment variable underscore user okay so this command adds the currently logged in user to the docker group okay so hit enter all right now we going to create a new group called Docker so to do so run the command new group Docker like that and hit enter all right so now let's check and confirm that the currently logged in user is part of the docker group so to do so simply run the command uh groups then the name of the user in this case it's James so groups James hit enter okay so you can see James now belongs to a group called Docker all right so let me clear the screen okay now we can check Docker version by running the command uh Docker uh version hit enter so this provides information about Docker so as you can see we have uh installed Docker version 20 4.0.5 you can see the API version which is 1.43 and a host of uh other information on the screen all right so that's one way of uh installing docka okay and just to confirm that you can run DOA without having to invoke sudu you can check uh the currently running containers by running the command uh Docker PS command so as you can see we don't have any running containers all right so in this step we have seen uh how to install Docker from the default repositories and bear in mind this method um does not necessarily give you the latest version of Docker so if you don't mind the kind of version to install that you want to use you can use this method now in the next method I'm going to show you how to install Docker from the official from the official Docker repository now now that method uh guarantees to give you the latest uh version of Docker so see you in the next method okay now in this method I'm going to demonstrate how to install Docker from the official Docker repository so as before the first step uh ensure that your system package list is up to date by running the command so do up update hit enter so as before this is going to update the local package index okay so just give it a few seconds all right now we are done okay now the next step we are going to install the prerequisite packages required during the installation of Docker all right and uh to do so um I'm going to run this command here on the screen as you can see on my notepad now I'm going to include these commands in the description so that you can follow along and test test it on your side all right so I'm going to copy this and I'm going to paste it on my terminal okay then I'm going to hit enter so this command installs all the prerequisite packages required during the installation all right so here I'm going to press enter and here enter as well to accept the defaults all right so we are done with the installation of the prerequisite packages okay now the next step I'm going to add the gpg key for the official Docker repository okay so once again I'm going to copy this command here all right so I'm going to copy this and paste it on my terminal okay then I'm going to hit enter all right so that The Next Step I'm going to add the docker repository to my system okay so to do so I'm going to copy the entire command here as you can see so this creates a Docker repository and uh it saves it in the ETC apt sources.list DOD directory okay so once again I'm going to paste this command okay then I'm going to to hit enter all right so now let's verify the existence of the repository so I'm going to view the Etsy AP sources.list DOD directory I'm going to hit enter so you can see here we have Docker do list all right okay so now the next step I'm going to update the local cache so that the system can be aware of the newly added repository so so I'm going to run the command sudu upt update once again and hit enter okay so you can see here that the system has recognized uh the existence of the docker repository all right now to install Docker simply run the command sudu apt install Docker hyphen CE which is a community ed version then hyphen y hit enter so as you can see on the screen the installation of Docker is underway all right so just be a little bit patient as the installation goes on all right so here I'm going to fast forward and I'll be back once the installation is complete okay the installation of Docker is now complete so I'm going to clear the screen so once again uh you're going to add the currently logged in user to the docker group so that you can run Docker commands without having to invoke sudu so to do so run the command sudu user mode hyphen a Docker then dollar sign user to add the currently logged in user to the docker group so hit enter okay then create a new group called Docker like that then hit enter okay now let's verify the user James is part of the docker Group by running the command groups James All right so you can see James is part of sudu and also part of Docker all right so now we can check the docker version installed by running the command Docker version like that okay so you can see here we have installed Docker version 2.0.3 and as you can see this is the latest version uh of Docker installed uh the pre in the first method we installed Docker version 24 so this is version 25 and as you can see installing from the default Docker repository gives you the latest Docker version all right so let's clear the screen now I'm going to check the version of I'm going to check the status of Docker by running the command sudu system C uh status docka okay you can see Docker is active and running as expected all right so once again you can also consider enabling Docker to start upon on a system reboot or a system startup by running the command sudo system CTL enable Docker and hit enter okay so as you can see uh Docker has been successfully enabled all right right okay so now um that's all for this video and in this video we have seen how to install Docker on your BTU run hello world okay and hit enter so as you can see we can see that uh okay so we are done so now as you can see uh Docker pulled an image a hello world image from um Docker Docker Hub and created a container that has generated this image uh so as you can see we have a message hello from Docker and uh down below you can see the steps taken by Docker to generate this image so Docker client contacted the docker demon uh then the docker demon pulled the hello world image from Docker Hub okay now once the image was pulled now the docker demon created a container from that image which runs the executable that provides or displays the output that you can see here all right then once it did that now the container exited okay so let's clear the screen and uh run Docker PS okay so as you can see the container exited and is no longer running but if you want to check all the containers including the ones that are stopped you can pass the hyphen a flag like that okay so here you can see we had uh a container called hello world okay that ran about a minute ago and exited once the output was streamed on the terminal all right so now this confirms that our Docker installation is uh correctly installed and configured and now you can run you can pull images and run the containers that you want okay so that's that's it for this uh video in our next video we are going to go deeper and see how to work with Docker containers and images so thank you guys for coming this far please subscribe to my channel and leave a like if you found this a video informational so see you in the next video
Info
Channel: james kiarie
Views: 317
Rating: undefined out of 5
Keywords: docker ubuntu, install docker ubuntu 22
Id: yPrhyaNKYfU
Channel Id: undefined
Length: 14min 49sec (889 seconds)
Published: Mon Mar 04 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.