How to install and configure Docker in Ubuntu?


Install Docker from Ubuntu Repository

  • $ sudo apt install

Below command will start Docker and ensure that starts after the reboot:

  • $ sudo systemctl start docker
  • $ sudo systemctl enable docker
  • $ docker –version


Docker version 17.03.2-ce, build f5ec1e2

Docker Login

  • $ sudo docker exec -it docker /bin/bash

Install the Dependencies

  • $ sudo apt update
  • $ sudo apt install apt-transport-https ca-certificates curl software-properties-common

Add Docker Repository

Create a new file for the Docker repository at /etc/apt/sources.list.d/docker.list. In that file, place one of the following lines choosing either stable, nightly or edge builds:

  • sudo add-apt-repository “deb [arch=amd64] bionic stable”

Next, you need to add Docker’s GPG key

$ curl -fsSL | sudo apt-key add –