You are here:

How to Install Docker on Ubuntu 18.04

Installation

Begin by running Ubuntu updates

  1. sudo apt update && sudo apt upgrade
  2. Confirm the download with Y
  3. Wait until the update and upgrade processes have completed

Initially, we need to install the necessary packages

  • sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

Add the Docker GPG key

  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Now we need to install the Docker repository

  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" Now we are able to install Docker

  • sudo apt-get update && sudo apt-get install docker-ce docker-ce-cli containerd.io Docker has been installed. Check if Docker is working

  • sudo docker run hello-worldIf you encounter the following message, it indicates that your Docker installation is functioning properly:

    Hello from Docker! This message shows that your installation appears to be working correctly.

Was this article helpful?
Dislike 0