How To Install Docker On Ubuntu 18.04 – Step By Step

How To Install Docker On Ubuntu 18.04 – Step By Step

April 27, 2020 / Nirav Shah

What is Docker ?

  • Docker is basically a container engine which uses the Linux Kernel features like namespaces and control groups to create containers on top of an operating system and automates application deployment on the container. Docker uses Copy-on-write union file system for its backend storage

Prerequisites

  • One Ubuntu 18.04 server
  • An account on Docker Hub if you wish to create your own images and push them to Docker Hub

Install Docker in the ubuntu server

  • Step 1: Update Software Repositories

    • It’s a smart thought to refresh the neighborhood database of programming to ensure you have access to the most recent updates.
    • Open a terminal window and type:
$ sudo apt-get update
  • Step 2: Uninstall Old Versions of Docker

    • Next, it’s prescribed to uninstall any old Docker programming before continuing.
    • Utilize the order:
$ sudo apt-get remove docker docker-engine docker.io
  • Step 3: Install Docker

    • To install Docker on Ubuntu, in the terminal window enter the command:
$ sudo apt install docker.io
  • Step 4: Start and Automate Docker

    • The Docker administration should be arranged to run at startup. To do as such, type in each order followed by enter:
$ sudo systemctl start docker
$ sudo systemctl enable docker

  • Step 5 (Optional): Check Docker Version

    • To verify the installed Docker version number, enter:
$ docker --version

Alternative: Install Docker from Official Repository

  • Step 1: Update Local Database

    • It’s a smart thought to refresh the neighborhood database of programming to ensure you have access to the most recent updates.
    • Open a terminal window and type:
$ sudo apt-get update
  • Step 2: Download Dependencies

    • You’ll have to run these orders to permit your working framework to get to the Docker stores over HTTPS.
    • In the terminal window, type:
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
    • To clarify, here’s a brief breakdown of each command:
      • apt-transport-https: Allows the package manager to transfer files and data over https
      • ca-certificates: Allows the system (and web browser) to check security certificates
      • curl: This is a tool for transferring data
      • software-properties-common: Adds scripts for managing software
  • Step 3: Add Docker’s GPG Key

    • The GPG key is a security feature.
    • To ensure that the software you’re installing is authentic, enter:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

  • Step 4: Install the Docker Repository

    • To install the Docker repository, enter the command:
$ sudo add-apt-repository "deb [arch=amd64]

https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”

Increasing space in the linux server

  • Step 5: Update Repositories

    • Update the repositories you just added:
$ sudo apt-get update
  • Step 6: Install Latest Version of Docker

    • To install the latest version of docker:
$ sudo apt-get install docker-ce
  • Step 7 (Optional): Install Specific Version of Docker

    • List the available versions of Docker by entering the following in a terminal window:
$ apt-cache madison docker-ce

    • The system should return a list of available versions
    • At this point, type the command:
$ sudo apt-get install docker-ce=

  • Step 8 (Optional): Check Docker Version

    • To verify the installed Docker version number, enter:
$ docker --version

Also Read:

Everything you Need to Know About Docker on Amazon ECS

How To Install WordPress In Docker Container

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let Us Talk About Your AWS Development Requirements

    Have queries about your AWS project ideas and concepts? Please drop in your project details to discuss with our AWS experts, professionals and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project