Install Docker 19.03 Ubuntu

$ sudo apt install docker-ce=5:19.03.113-0ubuntu-focal docker-ce-cli=5:19.03.113-0ubuntu-focal containerd.io Once you have installed Docker, you can confirm its status by running the command: $ sudo systemctl status docker. To install the latest version of Docker on Ubuntu, run the command below. Sudo apt install docker-ce docker-ce-cli containerd.io. Docker should now be installed, the service started and enabled to start on boot. In addition, you can check the Docker state using.

Docker is a free, open-source and cross-platform containerization tool that helps you to deploy and run the application in an isolated environment. Docker has become one of the most important parts of modern software development and DevOps pipelines.

In this tutorial, you will learn –

Prerequisites

  • A server running Ubuntu 20.04.
  • A root password is configured on your server.

Install Docker on Ubuntu

There are two ways to install Docker on Ubuntu 20.04. You can install Docker from the Ubuntu default repository or from the Docker’s official repository. The latest version of Docker is not included in the Ubuntu default repository. So it is always recommended to install Docker from Docker’s official repository.

In this section, we will show you how to install Docker on Ubuntu from Docker official repository.

Step 1 – Install Required Dependencies

First, you will need to install some prerequisite packages in your system. You can install them by running the following command:

Step 2 – Add Docker Official Repository

Next, you will need to import the GPG key and add the Docker repository to your system.

First, import the GPG key with the following command:

Next, add the Docker official repository using the following command:

Once the repository is added, update the repository cache with the following command:

Step 3 – Install Docker Ubuntu

Once the repository is updated, you can install the Docker on Ubuntu by running the following command:

This command will install the latest version of Docker from the Docker official repository.

Step 4 – Verify Docker Version

Developer.ibm.com › Tutorials › Install-docker-onInstall Docker On Linux Running On IBM Power Systems Servers

Once the Docker has been installed, you can verify the installed version of Docker with the following command:

You should get the following output:

Step 5 – Install a Specific Docker Version

If you want to install a specific Docker version, first list all available Docker versions using the following command:

You should see all the Docker version in the following output:

Now, install the specific version of Docker by adding =version after package name as shown below:

Step 6 – Manage Docker Services

To start the Docker service, run the following command:

To enable the Docker service at system reboot, run the following command:

To check the status of Docker service, run the following command:

Run Docker Commands Without Sudo

By default, Docker can be run as a root user or with Sudo privileges. If you want to run Docker commands as a non-root user then you will need to add your user to the docker group.

You can add your user to the docker group using the following command:

Install Docker 19.03 Ubuntu Windows 10

Now, your user can run Docker commands without specifying sudo.

Docker Basic Commands

You can list all commands available in Docker with the following command:

You should get a list of all commands in the following output:

To see system-wide information about Docker, run the following command:

Output:

How to Use Docker

At this point, Docker is installed and running in your system. Next, you will need to check whether you can access and download the image from DockerHub.

Let’s download the hello-world image from the DockerHub using the docker pull command:

This will download or pull the hello-world image from the DockerHub repository as shown below:

Next, verify the downloaded image with the following command :

Results

You should see your downloaded image in the following output:

Next, run a container from the hello-world image with the following command:

Install Docker 19.03 Ubuntu 20.04

You should see the following output:

How to Uninstall Docker

Install Docker 19.03 Ubuntu Free

If you want to uninstallDocker from your system. It is recommended to remove all Docker containers, images and volumes from your system.

See Full List On Ubuntu.pkgs.org

First, stop all running containers with the following command:

Once all containers are stopped, remove them with the following command:

Next, remove all Docker images with the following command:

Cached

Next, remove all docker objects with the following command:

Finally, remove the Docker package with all dependencies by running the following command:

Www.digitalocean.com › Community › TutorialsHow To Install And Use Docker On Ubuntu 20.04 DigitalOcean

Conclusion

In the above post, you learned how to install and use Docker on Ubuntu 20.04. To learn more about Docker, check out my all Docker tutorial.