In this blog post, we will explain how to install docker on Ubuntu 24.04 step-by-step.Docker provides container run time environment which allow developers to build, share and package the application inside a container. This container will have all the libraries, system tools along with the code, later using this container we can quickly deploy the application. System on which we install docker is known as docker engine.PrerequisitesPre-Install Ubuntu 24.04 LTSRegular User with sudo rights2 GB RAM and Dual core processorInternet Connectivity1) Add Docker Official GPG KeyTo install latest docker on Ubuntu 24.04 LTS, first we need to add docker docker repository GPG key using below set of commands. So, start the terminal and execute these commands one after the another.$ sudo apt update
$ sudo apt install ca-certificates curl -y
$ sudo install -m 0755 -d /etc/apt/keyrings
$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
$ sudo chmod a+r /etc/apt/keyrings/docker.asc2) Add Docker Official APT RepositoryAfter Installing docker gpg key, add its official apt repository by running the following echo command.$ echo \
“deb [arch=$(dpkg –print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo “$VERSION_CODENAME”) stable” | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null3) Install Docker on Ubuntu 24.04As we have enabled the docker official apt repository, so we are good to start the docker installation. Run following apt command to install latest version of docker on your Ubuntu 24.04 system.$ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -yOnce docker and its dependencies are installed then add your local user to docker group so that local user can run docker command with sudo.$ sudo usermod -aG docker $USER
$ newgrep docker
$ docker –versionVerify the docker service status,$ systemctl status dockerWhenever we install docker then it’s service should be started automatically, in case docker service is not running then execute following to start its service.$ systemctl start docker4) Test Docker InstallationIn order to test docker installation, let’s try to spin up a container using hello-world image. Run following docker command.$ docker run hello-worldAbove highlighted Informational message confirms that our docker installation is working fine.That’s all from this post, I hope you have found it informative and useful. Feel free to post your queries and feedback in below comments section.