Home » Docker Installation on Ubuntu/Linux

Docker Installation on Ubuntu/Linux

by Online Tutorials Library

Docker Installation

We can install docker on any operating system whether it is Mac, Windows, Linux or any cloud. Docker Engine runs natively on Linux distributions. Here, we are providing step by step process to install docker engine for Linux Ubuntu Xenial-16.04 [LTS].

Prerequisites:

Docker need two important installation requirements:

  • It only works on a 64-bit Linux installation.
  • It requires Linux kernel version 3.10 or higher.

To check your current kernel version, open a terminal and type uname -r command to display your kernel version:

Command:

Docker Installation 1


Update apt sources

Follow following instructions to update apt sources.

  1. Open a terminal window.
  2. Login as a root user by using sudo command.
  3. Update package information and install CA certificates.
  4. Command:

    See, the attached screen shot below.

    Docker Installation 2

  5. Add the new GPG key. Following command downloads the key.
  6. Command:

    Screen shot is given below.

    Docker Installation 3

  7. Run the following command, it will substitute the entry for your operating system for the file.
  8. See, the attached screen shot below.

    Docker Installation 4

  9. Open the file /etc/apt/sources.list.d/docker.listand paste the following line into the file.
  10. Docker Installation 5

  11. Now again update your apt packages index.
  12. Docker Installation 6

    See, the attached screen shot below.

  13. Verify that APT is pulling from the right repository.
  14. See, the attached screen shot below.

    Docker Installation 7

  15. Install the recommended packages.
  16. Docker Installation 8


Install the latest Docker version.

  1. update your apt packages index.
  2. See, the attached screen shot below.

    Docker Installation 9

  3. Install docker-engine.
  4. See, the attached screen shot below.

    Docker Installation 10

  5. Start the docker daemon.
  6. See, the attached screen shot below.

    Docker Installation 11

  7. Verify that docker is installed correctly by running the hello-world image.
  8. See, the attached screen shot below.

    Docker Installation 12

    This above command downloads a test image and runs it in a container. When the container runs, it prints a message and exits.


You may also like