Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

How to Install Docker on Ubuntu 20.04

by Cloudbooklet
3 years ago
in Google Cloud
How To Install Docker On Ubuntu 20.04
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

How to Install Docker on Ubuntu 20.04. Docker is a open-source platform that uses OS-level virtualization to deliver software in packages called containers. Container is a unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. Docker container technology was launched […]

ADVERTISEMENT

How to Install Docker on Ubuntu 20.04. Docker is a open-source platform that uses OS-level virtualization to deliver software in packages called containers. Container is a unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another.

Docker container technology was launched in 2013 which jump started a revolution in application development – by democratizing software containers. 

In this guide you are going to learn how to install Docker on Ubuntu 20.04 LTS.

ADVERTISEMENT

This setup is tested on Google Cloud Platform so it will work fine on any cloud servers or any VPS or any dedicated servers running Ubuntu 20.04.

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago

Prerequisites

  1. If you are on GCP, see the Setting up Compute Engine Instance.

Start by updating the packages to the latest version available.

sudo apt update
sudo apt upgrade

Step 1: Install Docker

Make sure you install the latest version of Docker from the official Docker repository. The official Ubuntu repository also has the Docker installation package, but it may not be the latest version.

ADVERTISEMENT

Let’s start installing Docker.

Install some packages which allows you to use the packages over HTTPS.

ADVERTISEMENT
sudo apt install apt-transport-https ca-certificates curl software-properties-common

Add the GPG key of Docker repository.

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

Now add the Docker repository of Ubuntu 20.04 (|focal) to the apt sources.

ADVERTISEMENT
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"

Update the packages index and setup your server to install Docker from official Docker repo.

sudo apt update
sudo apt-cache policy docker-ce

You will receive an output similar to this.

ADVERTISEMENT
Output
docker-ce:
   Installed: (none)
   Candidate: 5:19.03.9~3-0~ubuntu-focal
   Version table:
      5:19.03.9~3-0~ubuntu-focal 500
         500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

Now you can install Docker.

sudo apt install docker-ce

Once Docker is installed and the process is enabled to start on boot.

To check the status of Docker you can use the following command.

sudo systemctl status docker

The output will be like this.

Output
● docker.service - Docker Application Container Engine
     Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-05-22 09:18:43 UTC; 29s ago

Configure Sudo permissions for Docker

The docker command can only be executed as root user by default. If you need to run the docker command without sudo, you need to add your username to the docker group.

sudo usermod -aG docker username

Now restart your SSH or open a new terminal to see the changes.

From now you use the docker command without sudo.

Using Docker Commands

To view the system information about Docker.

docker info

Download Docker Images

docker run hello-world

If the output you get is similar to the below then you can access and download images from Docker Hub.

Output
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
0e03bdcc26d7: Pull complete
Digest: sha256:6a65f928fb91fcfbc963f7aa6d57c8eeb426ad9a20c7ee045538ef34847f44f1
Status: Downloaded newer image for hello-world:latest

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

Run the below command to see downloaded images.

docker images

Docker Commands

Once you have started using Docker you will have many active and inactive containers.

To view all active containers, use the following command.

docker ps

To view all containers which are active and inactive, use the below command.

docker ps -a

To view the latest container

docker ps -l

To start a docker container, use docker start command followed by the Container ID or Container Name.

docker start container-id/name

Likewise to stop a running container you can use the docker stop command followed by Container ID or Container Name.

docker stop container-id/name

If you no longer need the container you can remove the container with the docker rm followed by Container ID or Container Name.

docker rm container-id/name

To enter into interactive shell you can use the following command.

docker run -it container-id/name

You can manually install commands inside the shell.

For more details about docker commands use the docker run help command.

Get your Professional Google Cloud Architect certificate with this easy to learn course now.

Conclusion

Now you have learned how to install and manage Docker on Ubuntu 20.04.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: DockerUbuntu 20.04
ShareTweetSendShare
Cloudbooklet

Cloudbooklet

Comments 1

  1. Avatar Of Kanishka Kanishka says:
    2 years ago

    Great Article to start with Docker on EC2 instance.
    Thank you!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Ai Soulmate

5 Free AI Soulmate Maker: Create Your Perfect Match

September 18, 2023

How to Block YouTube Ads on Android TV in 2023 (6 Easy Methods)

Top 10 Advantages of a Cloud VPS Server

Microsoft Unveils New Disc-Less Xbox Series X with Lift-to-Wake Controller

AI Annotation Jobs: Everything You Need to Know

Microsoft Editor vs Grammarly: Which is the Best Grammar Checker?

Popular Articles

Ai Avatar Generator

7 Best AI Avatar Generator Tools to Try Online

September 13, 2023

How to Install Waifu Diffusion – Step-by-Step Guide

Top 7 AI Dream Interpreter to Understand Your Dreams

10 Free Business Email Account Providers in 2023

Google and Bing in Action to Prevent Spread of AI Child Porn

AI Emotion Detector: Detect and Interpret Human Emotions Accurately

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.