How to Install and Use Docker on Ubuntu 20.04

How to Install and Use Docker on Ubuntu 20.04

This article is a good starting point for beginners to learn how to install and use Docker on a Ubuntu 20.04 Linux system with some basic commands. For this guide, we will install Docker Community Edition (CE).

Docker is a most popular, open-source platform for developers and system administrators to build, run, and share applications with containers. Containerization (the use of containers to deploy applications) is becoming popular because containers are flexible, lightweight, portable, loosely coupled, scalable, and more secure.

This article is a good starting point for beginners to learn how to install and use Docker on a Ubuntu 20.04 Linux system with some basic commands. For this guide, we will install Docker Community Edition (CE).

Prerequisites:

Installing Docker on Ubuntu 20.04

To use the latest version of Docker, we will install it from the official Docker repository. So, start by adding the GPG key for the official Docker repository to your system, after that add the repository configuration to the APT source with the following commands.

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Now update the APT package cache to include the new Docker packages to the system using the following command.

$ sudo apt update

Next, install the Docker package as shown.

$ sudo apt install docker-ce

Install Docker on Ubuntu

Install Docker on Ubuntu

During the Docker package installation process, the package installer triggers the systemd (system and service manager) to automatically start and enable the docker service. Using the following commands to confirm that the docker service is active and is enabled to automatically start at system startup. Also, check its status:

$ sudo systemctl is-active docker
$ sudo systemctl is-enabled docker
$ sudo systemctl status docker

Check Docker Status

Check Docker Status

There are several other systemctl commands to manage and control the docker service which includes the following:

$ sudo systemctl stop docker            #stop the docker service
$ sudo systemctl start docker            #start the docker service
$ sudo systemctl  restart docker        #restart the docker service

To check the version of Docker CE installed on your system, run the following command:

$ docker version

Check Docker Version

Check Docker Version

You can view available docker usage commands by running the docker command without any options or arguments:


$ docker

List of Docker Commands

List of Docker Commands

docker ubuntu docker tips ubuntu tips

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Docker Explained: Docker Architecture | Docker Registries

Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.

Install Docker | Docker Compose on Ubuntu 20.04

This brief tutorial shows students and new users how to install Docker and Docker Compose on Ubuntu 20.04 | 18.04. Docker software allows visualization at the operating system level..

How to Install Microsoft Teams on Ubuntu 20.04

In this tutorial, we will show you how to install Microsoft Teams on Ubuntu 20.04 machine. we can install teams using Debian installer file or by adding microsoft repository.

How to Install, Run and Delete Applications Inside Docker Containers - Part 2

In this tutorial will discuss how to save a Docker container into a new image, remove a container and run a Nginx web server into a container in RHEL/CentOS 8/7.

How to Install Docker on Ubuntu 20.04

This tutorial covers how to install Docker on an Ubuntu 20.04 machine. Docker is an open-source containerization platform that allows you to quickly build, test, and deploy applications as portable containers that can run virtually anywhere.