Skip to main content

Install Docker on Ubuntu

Updated Jul 07, 2022 ·

Manual Method

This is a summary of the commands that you can run to install docker on Ubuntu.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" &&
sudo apt-get update -y
sudo sudo apt-get install docker-ce docker-ce-cli containerd.io -y
sudo usermod -aG docker ubuntu

For more information, please see official Docker installation guide for more details.

Using Terraform

Whether you've dabbled around in Terraform or not, this is the fastest way to provision a resource in AWS with Docker installed. This will provision the following:

  • A VPC
  • An EC2 instance with Docker installed

For more details, check out this repository.