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

Social Media Marketing: A Key to Business Success with Easy Digital Life

In today's digital-first world, businesses must adopt effective strategies to stay competitive. Social media marketing…

14 minutes ago

Best 7 AI Tools Every UI/UX Designer Should Know About

62% of UX designers now use AI to enhance their workflows. Artificial intelligence (AI) rapidly…

2 days ago

How AI Enhances Photoshop Workflow: A Beginner’s Guide

The integration of artificial intelligence into graphic design through tools like Adobe Photoshop can save…

2 weeks ago

The Rise Of Crypto Trading Bots: A New Era In Digital Trading

The cryptocurrency trading world has grown significantly in recent years, with automation playing a key…

3 weeks ago

Real-World Insights on White-Label NFT Marketplace Development

The non-fungible token (NFT) market has witnessed explosive growth over the past few years, transforming…

3 weeks ago

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…

1 month ago

This website uses cookies.