---
title: Install Docker on AWS EC2 (Ubuntu 16.04)
description: Docker is a program that can implement a virtualization on your machine and you can pull any image of Operating System and launch that very light weight image on your machine. And you can create and run several operating systems in your single host machine.
image: https://blog.e-zest.com/hubfs/install-docker-on-aws-ec2.png
---

[![e-Zest logo\_An accion lab company\_Colour](https://blog.e-zest.com/hubfs/images/Logos%20with%20Tagline/Corporate/SVG/e-Zest%20logo_An%20accion%20lab%20company_Colour.svg "e-Zest logo_An accion lab company_Colour")](https://www.e-zest.com/)

- [WORK](https://www.e-zest.com/our-work)
- [SERVICES](https://www.e-zest.com/our-services) 
    - [Product Engineering](https://www.e-zest.com/digital-product-engineering-services)
    - [Enterprise Data Services](https://www.e-zest.com/enterprise-data-services)
    - [Digital Commerce](https://www.e-zest.com/digital-commerce-services)
    - [Digital Operations](https://www.e-zest.com/digital-operations)
    - [Digital Consulting](https://www.e-zest.com/digital-transformation-consulting-services)
    - [Digital Experience Design](https://www.e-zest.com/digital-experience-design)
- [INSIGHTS](https://blog.e-zest.com/)
- [CAREERS](https://www.e-zest.com/careers)
- [ENTERPRISE DATA SERVICES](https://www.e-zest.com/enterprise-data-services)
- [GENERATIVE AI](https://www.e-zest.com/generative-ai)
- [Healthcare](https://healthcare.e-zest.com)
- [Contact Us](https://www.e-zest.com/contact-us)

- ![Elevating Product Engineering with AI and ML](https://blog.e-zest.com/hubfs/Elevating%20Product%20Engineering%20with%20AI%20and%20ML.jpg)

  [BLOGS](https://blog.e-zest.com)
  
  #### Elevating Product Engineering with AI and ML

  As technology evolves and customer choices broaden, there is an increasing ...

  [Read more](https://blog.e-zest.com/elevating-product-engineering-with-ai-and-ml)
- ![e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024](https://blog.e-zest.com/hubfs/e-Zest%20%E2%80%93%20An%20Accion%20Labs%20Company%20-%20Gets%20Recognition%20as%20a%20Contender%20in%20the%20ISG%20Provider%20LensTM%20Study%20on%20Digital%20Engineering%20Services%202024.jpg)

  [NEWS](https://blog.e-zest.com/news)
  
  #### e-Zest – An Accion Labs Company gets Recognition as a Contender in the ISG Provider Lens™ Study on Digital Engineering Services 2024

  We are delighted to announce that e-Zest – An Accion Labs Company has been ...

  [Read more](https://blog.e-zest.com/news/e-zest-an-accion-labs-company-gets-recognition-as-a-contender-in-the-isg-provider-lens-study-on-digital-engineering-services-2024)
- ![e-Zest Solutions supports Digital Pune Mission](https://blog.e-zest.com/hubfs/blog-files/Digital%20Literacy%20Bus%20e-Zest.png)

  [CSR](https://blog.e-zest.com/csr)
  
  #### e-Zest Solutions supports Digital Pune Mission

  **Pune, India:** e-Zest Solutions, a leading digital technology innovation ...

  [Read more](https://blog.e-zest.com/csr/e-zest-solutions-supports-digital-pune-mission)

- [Work](https://www.e-zest.com/our-work)
- [Services](https://www.e-zest.com/our-services)
- [Insights](https://blog.e-zest.com)
- [Careers](https://www.e-zest.com/careers)
- [Enterprise Data](https://www.e-zest.com/enterprise-data-services)
- [Generative AI](https://www.e-zest.com/generative-ai)
- [Innovations](https://www.e-zest.com/innovations)
- [Healthcare](https://healthcare.e-zest.com)
- [About](https://www.e-zest.com/about-us)
- [Contact](https://www.e-zest.com/contact-us)

- [Blog](https://blog.e-zest.com/)
- [News](https://blog.e-zest.com/news)
- [CSR](https://blog.e-zest.com/csr)

- [![Linkedin Icon](https://blog.e-zest.com/hubfs/icons/linkedin_icon_white.svg)](https://www.linkedin.com/company/e-zest-solutions/)
- [![Twitter Icon](https://blog.e-zest.com/hubfs/twitter-logo-silhouette%20(5).svg)](https://twitter.com/ezest)
- [![Facebook Icon](https://blog.e-zest.com/hubfs/facebook-app-logo%20(4).svg)](https://www.facebook.com/61259256638)
- [![Instagram Icon](https://blog.e-zest.com/hubfs/instagram-logo%20(4).svg)](https://www.instagram.com/ezestsolutions/)
- [![Youtube Icon](https://blog.e-zest.com/hubfs/icons/youtube_icon_white.svg)](https://www.youtube.com/user/ezestcorporate)

[![Go to top icon](https://blog.e-zest.com/hubfs/AA%20Assets/top%20button.svg)](https://blog.e-zest.com/install-docker-on-aws-ec2#top)

Hit enter to search or ESC to close

Insights

e-Zest members share technology ideas to foster digital transformation.

- [Blog](https://blog.e-zest.com)
- [Whitepaper](https://blog.e-zest.com/whitepaper)
- [Playbook](https://blog.e-zest.com/playbook)
- [News](https://blog.e-zest.com/news)
- [Innovation](https://blog.e-zest.com/innovation)
- [Media Kit](https://www.e-zest.com/media-kit)

# Install Docker on AWS EC2 (Ubuntu 16.04)

[Amit Tidke](https://blog.e-zest.com/author/amit-tidke)  Nov 14, 2018

[Docker](https://blog.e-zest.com/topic/docker) [Docker Tutorial](https://blog.e-zest.com/topic/docker-tutorial) [EC2](https://blog.e-zest.com/topic/ec2) [Ubuntu](https://blog.e-zest.com/topic/ubuntu) [Ubuntu 16.04](https://blog.e-zest.com/topic/ubuntu-16-04)

- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/install-docker-on-aws-ec2&title=&summary=&source=>
- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/install-docker-on-aws-ec2&text=Install%20Docker%20on%20AWS%20EC2%20(Ubuntu%2016.04)>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/install-docker-on-aws-ec2>
- <https://www.instagram.com/ezestsolutions/?u=https://blog.e-zest.com/install-docker-on-aws-ec2>

Docker is a program that can implement a virtualization on your machine and you can pull any image of Operating System and launch that very light weight image on your machine. And you can create and run several operating systems in your single host machine. We can call these launched images as docker containers. Multiple containers will help us in decoupling the application dependencies. For example, we can have Web Server, Application Server & Databases in separate containers.

**Here’s how:**

Step 1: We have to create a separate user for docker. So add a new user using this command:  
adduser *docker*

Step 2: Add this user to the Sudoers Group  
visudo

Step 3: Add the the line “root ALL=(ALL:ALL) ALL ”:  
docker ALL=(ALL:ALL) ALL

Step 4: Switch to docker user

sudo su docker

Step 5: Add GPG key for the official docker repository

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

Step 6: Add the docker repository and update the package

sudo add-apt-repository "deb \[arch=amd64\] https://download.docker.com/linux/ubuntu $(lsb\_release -cs) stable"  
sudo apt-get update

Let’s check if we have configured the docker repository properly.

apt-cache policy docker-ce

The output should display that we are using docker-ce.  
  
**Docker Installation:**

Installation command:

sudo apt-get install -y docker-ce

This command will install the docker and will start the docker daemon.  
To check if this process is configured to start on boot:

sudo systemctl status docker

**Executing Docker commands without sudo:**

This part is optional but if you rather not use “sudo” with each command then you should have a look at this part of blog.

We have to add the username to the docker group

sudo usermod -aG docker ${USER}

To apply this change, either we have to logout & login again or make use of the following command.

su - ${USER}

This will ask for a password and now you can check if you have added this user to the group or not.

id –nG

**Test the Docker**

Once you have checked off the above steps relating to docker installation, we would need to check if our machine could access the Docker hub. This will download and run the hello-world program.

docker run hello-world

This should display the output as

"Hello from Docker!  
This message shows that your installation appears to be working correctly."

This confirms that we have successfully installed and configured the docker on our machine. You are now ready to explore many awesome things with the Docker!

- <https://twitter.com/intent/tweet?source=https://blog.e-zest.com/install-docker-on-aws-ec2&text=Install%20Docker%20on%20AWS%20EC2%20(Ubuntu%2016.04)>
- <https://www.facebook.com/sharer/sharer.php?u=https://blog.e-zest.com/install-docker-on-aws-ec2>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.e-zest.com/install-docker-on-aws-ec2&title=&summary=&source=>

### Similar Blog

[![How to setup Docker Container for Magento 2](https://blog.e-zest.com/hubfs/How%20to%20setup%20Docker%20Container%20for%20Magento%202.jpg) How to setup Docker Container for Magento 2 Docker is an application that allows us to manage multiple applications in the simplest way in the docker container. Docker ... By Rajesh Rathod Oct 15, 2021](https://blog.e-zest.com/how-to-setup-docker-container-for-magento2)

[![Docker Tutorial: Using it as a server Migration Tool](https://blog.e-zest.com/hs-fs/file-3395404509-png/blog-files/docker-tutorial.png) Docker Tutorial: Using it as a server Migration Tool **Public Cloud (e.g. AWS, Azure) \<-\> Private Cloud (e.g. Openstack) \<-\>physical servers** By Kunal Shah May 04, 2015](https://blog.e-zest.com/docker-tutorial-using-it-as-a-server-migration-tool/)

[Setting up SFTP Server on Amazon EC2 SFTP also known as SSH File Transfer Protocol, enables a secured data transfer between SFTP server and client machine. SFTP ... By Amit Tidke Apr 05, 2017](https://blog.e-zest.com/setting-up-sftp-server-on-amazon-ec2)

[MongoDB Installation on Amazon Linux MongoDB is an open source NoSQL database that uses a document-oriented data model. MongoDB is built on architecture of collection ... By Amit Tidke Feb 02, 2017](https://blog.e-zest.com/mongodb-installation-on-amazon-linux)

[Setup Apache Basic Authentication for your website Apache is most popular web server used nowadays. It is open-source software developed by Apache Software Foundation. By Amit Tidke Sep 28, 2016](https://blog.e-zest.com/setup-apache-basic-authentication-for-your-website)

[![10 most common mistakes you should avoid while managing AWS](https://blog.e-zest.com/hubfs/Presentation1-3.png) 10 most common mistakes you should avoid while managing AWS Amazon Web Services (AWS) is a collection of cloud computing services, also known as web services that make up a cloud platform. ... By Amit Tidke May 23, 2016](https://blog.e-zest.com/10-most-common-mistakes-you-should-avoid-while-managing-aws)

## Helping Organizations Thrive in the Digital Age

[Contact Us](https://www.e-zest.com/contact-us)

- [About](https://www.e-zest.com/about-us)
- [Services](https://www.e-zest.com/our-services)
- [Work](https://www.e-zest.com/our-work)
- [Insights](https://blog.e-zest.com/)
- [Healthcare](https://healthcare.e-zest.com/)
- [Accion Labs](https://www.accionlabs.com/)

- <https://www.linkedin.com/company/e-zest-solutions/>
- <https://twitter.com/ezest>
- <https://www.facebook.com/eZest/>
- <https://www.instagram.com/ezestsolutions/>
- <https://www.youtube.com/user/ezestcorporate>

- Dallas
- Detroit
- Hannover
- Vienna
- London
- Pune

 © 2025 e-Zest Solutions

- [Privacy Policy](https://www.e-zest.com/privacypolicy)
- [Cookie Policy](https://www.e-zest.com/cookie-policy)

 Contact us

 Contact us

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.