How to install Docker on Ubuntu

Today we focusing How to install Docker on Ubuntu.

In this article we will talk how to Install Docker on Ubuntu. Docker is an open-source containerization platform that enables you to quickly build, test, and deploy applications as small containers that can run anywhere. A container represents the runtime for an application and contains everything the software needs to run. Docker is an integral part of modern software development and DevOps pipelines for continuous integration and deployment.

Docker is a very popular containerization platform that allows developers to build and deploy applications in containers. Containers are isolated environments that house an entire application with its dependencies, libraries, configuration files, and everything needed to run it, outside of the computing environment. Below are the 6 steps to install Docker on Ubuntu.

How to Install Docker on Ubuntu

Update the system

  • The first step is to update the repositories. To do this, run the command:

Establish dependencies

  • Some dependencies are required for installation to go smoothly. So, run the following command to install them:
    • $ sudo apt install apt-transport-https curl gnupg-agent ca-certificates software-properties-common -y
  • Once the dependencies are installed, proceed to the next step.

Install Docker on Ubuntu 22.04

  • With the requirements installed, the next step is to install Docker. We will install Docker Community Edition (Docker CE), which is open source and free to download and use.
  • To do so, let’s add the GPGK key
    • $ curl -fsSL | sudo apt-key add –
  • Once added, add the Docker repository as follows.
  • Since Ubuntu 22.04 is not officially released yet, add the repository for Ubuntu 20.04 stable.
    • $ sudo add-apt-repository “deb [arch=amd64] focal constant”
  • Add the GPG key and repository and run the following command to install Docker and its associated packages.
    • $ sudo apt install docker-ce docker-ce-cli containerd.io -y
  • It installs Docker and all additional packages, libraries and dependencies required by Docker and related packages.
  • Once the command runs successfully, consider adding the currently logged in user to the Docker group. This allows you to run docker without calling sudo.
    • $ sudo usermod -aG docker $USER
    • $ newgrp docker
  • You can now run docker commands as a regular user without any challenges.

Make sure Docker is installed

  • To check if Docker is installed, run the command:
  • From the release, you can see that at the time we publish this, we have installed Docker 20.10, the latest version of Docker. guide.

Manage the Docker service

  • By default, Docker starts automatically during installation. To verify this, run the command:
    • $ sudo systemctl status docker
  • If for any reason Docker is not running, run the following command:
    • $ sudo systemctl start docker
  • To start Docker automatically every time the system starts, run the command:
    • $ sudo systemctl run docker
  • To restart Docker operation:
    • $ sudo systemctl Restart docker

Test docker

  • To give Docker a test run, let’s grab a ‘hello-world’ image from Docker Hub. From the image, a container will be created which will display a ‘hello world’ message in the terminal along with the steps of what happened after the command was executed.
  • So, we run the command:
  • To confirm the images on the computer, run the command:
  • After the container is created, it is automatically exited or stopped. You can still check stopped containers.

Final words

We hope you like our article on installing Docker on Ubuntu. Docker is a set of platform-as-a-service products used to launch and manage containers. Developers use Docker containers for application development and deployment because they provide isolated, lightweight, virtual environments.

Faq

About This Guide?


In this guide, we told you about the How to install Docker on Ubuntu; please read all steps above so that you understand How to install Docker on Ubuntu in case if you need any assistance from us, then contact us.

How this tutorial or guide assisting you?


So in this guide, we discuss the How to install Docker on Ubuntu, which undoubtedly benefits you.



Share this article about How to install Docker on Ubuntu

I hope you like the guide How to install Docker on Ubuntu. In case if you have any queries regards this article/tutorial you may ask us. Also, share your love by sharing this article with your friends and family.
#install #Docker #Ubuntu

Shagun Teotia
Trickbugs: Tips and Tutorials
Logo