Docker Guides

How to install Docker on Ubuntu ?

Docker as we know, is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. In this post, we are going to take look at how to install Docker on Ubuntu 18 LTS.

Requisites

Ubuntu OS requirements: Docker CE (Community Edition) supports the following 64-bit versions

  • Bionic 18.04 (LTS)
  • Artful 17.10
  • Xenial 16.04 (LTS)
  • Trusty 14.04 (LTS)

For Docker EE (Enterprise Edition) please refer Docker documentation

Install Steps

  1. [Optional Step] this step is required only if you have older versions of the docker, uninstall using below commands
    sudo apt-get remove docker docker-engine docker.io

    Image – Uninstall Docker

  2. Update apt packages
    sudo apt-get update

    Image – Update Packages

  3. Install following Packages
    • apt-transport-https
    • ca-certificates
    • curl
    • software-properties-common
      sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common

      Image – Install Packages

  4. Setup Docker’s official GPG key
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

    Image – Setup Docker GPG Key

  5. Verify key with the fingerprint
    sudo apt-key fingerprint 0EBFCD88

    Image – Verify key

  6. Add Stable repository (this command applies only to x86_64 / amd64 platform)
    sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable"

    Image – Add Stable repository

  7. Install Docker CE edition
    sudo apt-get update
    Image – Run apt-get update before install

    sudo apt-get install docker-ce

    Image – Install Docker CE

  8. Verify Docker installation by running the hello-world image
    sudo docker run hello-world

    Image – Verify Docker CE installation

Post Installation Steps

Docker daemon binds to a Unix socket instead of a TCP port. By default, Unix socket is owned by the user root and other users can only access it using sudo command. Docker daemon always runs as the root user. To avoid using sudo command every time follow the below steps:

  1. Create Docker group (must have been already created if not create new)
    sudo groupadd docker
  2. Add current user to Docker group
    sudo usermod -aG docker $USER

    Image – Add current user to Docker group

  3. Verify that you can run docker commands without sudo.
    docker run hello-world

    Image – Validate Docker Installation

Now that we have installed Docker CE, its time to understand a bit about the internals of Docker as well.

Docker components

Docker uses a client-server architecture. Docker client (docker command line interface) talks to the Docker daemon, which does all the heavy lifting of building, running, and distributing our Docker containers. The Docker client and daemon can run on the same system, or there is also an option to connect a Docker client to a remote Docker daemon.

Image – Docker components (Source – Docker)
  1. Docker Daemon: Docker daemon listens for Docker API requests and manages Docker objects such as images, containers, networks, and volumes.
  1. Docker client: Docker users interact with Docker using Docker client. When you use commands such as docker run, the client sends these commands to Docker Daemon, which carries them out. The Docker client uses the Docker API.
  1. Docker registry stores Docker images. Docker Hub and Docker Cloud are public registries that anyone can use, and Docker is configured to look for images on Docker Hub by default. There is also an option to run a private registry.
  1. Docker Image is a read-only template with instructions for creating a Docker container. Often, an image is based on another image, with some additional customization.
  1. Docker container is a runnable instance of an image. We can create, start, stop, move, or delete a container using the Docker API or CLI. We can connect a container to one or more networks, attach storage to it, or even create a new image based on its current state.
  1. Dockerfile defines the steps needed to create the image and run it.

In this post, we have learned how to install Docker on Ubuntu 18. There is much more to the Docker platform than what was covered here, but now you would have got a good idea of the different components and how to configure Docker.

For other posts about Docker, check out here.

Like this post? Don’t forget to share it!

Additional Resources:

Summary
Article Name
How to install Docker on Ubuntu ?
Description
Docker as we know,is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.In this post, we are going to take look at how to install Docker on Ubuntu
Author
Publisher Name
Upnxtblog
Publisher Logo
Karthik

Allo! My name is Karthik,experienced IT professional.Upnxtblog covers key technology trends that impacts technology industry.This includes Cloud computing,Blockchain,Machine learning & AI,Best mobile apps, Best tools/open source libs etc.,I hope you would love it and you can be sure that each post is fantastic and will be worth your time.

Share
Published by
Karthik
Tags: dockerubuntu

Recent Posts

Finding the Right Time to Build Your Software Instead of Buy

There are few things as valuable to a business as well-designed software. Organizations today rely…

5 days ago

Innovators in Crypto: Prominent AI-Powered Coins

The cryptocurrency industry is being reshaped by the fusion of blockchain technology and artificial intelligence…

3 weeks ago

Top AI Design Tools Every Graphic Designer Should Use in 2024

Introduction Artificial Intelligence (AI) has also found its relevance in graphic design and is quickly…

2 months ago

Transforming Industries: The Integration of AI and Blockchain

Imagine a world where the brilliance of Artificial Intelligence (AI) meets the unbreakable security of…

2 months ago

How Can I Use Automation to Streamline My Digital Marketing Efforts?

In today’s fast-paced digital landscape, automation is not just a luxury but a necessity for…

2 months ago

Top 5 AI Technologies Transforming the Casino Gaming Landscape in 2025

The world of casino gaming has leveraged the emerging technology advancements to create immersive and…

3 months ago

This website uses cookies.