How to install Docker on Ubuntu Linux 18.04 desktop machine?

How to install Docker on Ubuntu Linux 18.04 desktop machine?

    Docker is available in two editions: Community Edition (CE) and Enterprise Edition (EE). Here, we'll proceed with Docker CE, the Community Edition. To do a clean installation, you must first remove existing Docker installation, if anything found. And then proceed with Docker installation by configuring and updating its Debian repository on our local machine. This is most recommended way of installing Docker on Ubuntu Linux operating system. Once the installation is done, you need to verify Docker version to check whether it is properly installed or not.

# Remove old Docker installations to make fresh install.
$ sudo apt remove docker docker-engine docker.io containerd runc

# Check if update available for system packages.
$ sudo apt update

# Install required system packages.
$ sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

# Add Docker's official GPG key to package manager.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo apt-key fingerprint 0EBFCD88

# Add Docker repository to package manager source list.
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

# Install Docker packages from repository.
$ sudo apt install docker-ce docker-ce-cli containerd.io

# Check Docker version.
$ sudo docker --version
 
# Enable Docker service at boot.
$ sudo systemctl enable docker.service

    • Related Articles

    • How to install Docker on CentOS Linux 7 server machine?

      Docker is available in two editions: Community Edition (CE) and Enterprise Edition (EE). Here, we'll proceed with Docker CE, the Community Edition. To do a clean installation, you must first remove existing Docker installation, if anything found. And ...
    • How to install VirtualBox on Ubuntu Linux 18.04 desktop machine?

      If you have a host machine that runs Ubuntu Linux operating system, then you need to install VirtualBox to build and run virtual machines. Now, let's see how to do VirtualBox installation on Linux host machine. # Install required system packages. $ ...
    • How to install Vagrant on Ubuntu Linux 18.04 desktop machine?

      If you have a host machine that runs Ubuntu Linux operating system, then you need to install Vagrant to automate and manage virtual machines. Now, let's see how to do Vagrant installation on Linux host machine. # Download Vagrant. $ wget ...
    • How to install Git on Ubuntu Linux 18.04 desktop machine?

      Here, we install Git using system package manager. This is most recommended way of installing Git on Ubuntu Linux operating system. No matter how we install Git, its just a command line utility. Once the installation is done, you need to verify Git ...
    • How to install Kubernetes client on Ubuntu Linux 18.04 desktop machine?

      Here, we install Kubernetes client on the host machine, so that a system user can connect and operate the Kubernetes cluster. Later, we have to create a Kubernetes user with proper credentials to operate the Kubernetes cluster using the installed ...