• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install Docker and run images on Ubuntu 21.04

  • 00:34 lsb_release -a
  • 00:44 sudo -s
  • 01:08 apt update
  • 01:48 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
  • 02:11 add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
  • 02:48 apt-cache policy docker-ce
  • 03:38 docker run hello-world
6705

To Install Docker and Run Images on Ubuntu 21.04

Introduction:

Docker is an application that simplifies the process of managing applications, as it provides OS-level virtualization to deliver software in packages called containers. Containers are isolated and contain their own software.

Installation Procedure:

Step 1: Check the OS version by using the following command

linuxhelp@linuxhelp:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 21.04
Release:	21.04
Codename:	hirsute

Step 2: Login as root user by using the following command

linuxhelp@linuxhelp:~$ sudo -s
[sudo] password for linuxhelp:

Step 3: Changing to the home directory

root@linuxhelp:/home/linuxhelp# cd ~

Step 4: Updating the packages

root@linuxhelp:~# apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu hirsute InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu hirsute-updates InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu hirsute-backports InRelease      
Get:4 http://security.ubuntu.com/ubuntu hirsute-security InRelease [110 kB]
Get:5 http://security.ubuntu.com/ubuntu hirsute-security/main amd64 DEP-11 Metadata [9,668 B]
Get:6 http://security.ubuntu.com/ubuntu hirsute-security/universe amd64 DEP-11 Metadata [5,700 B]
Fetched 126 kB in 2s (69.0 kB/s)                      
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
161 packages can be upgraded. Run 'apt list --upgradable' to see them.

Step 5: Installing prerequisites packages

root@linuxhelp:~# apt install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
software-properties-common is already the newest version (0.99.10).
software-properties-common set to manually installed.
ca-certificates is already the newest version (20210119ubuntu0.21.04.1).
ca-certificates set to manually installed.
The following NEW packages will be installed:
  apt-transport-https curl
0 upgraded, 2 newly installed, 0 to remove and 161 not upgraded.
Need to get 175 kB of archives.
After this operation, 596 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://in.archive.ubuntu.com/ubuntu hirsute-updates/universe amd64 apt-transport-https all 2.2.4ubuntu0.1 [4,776 B]
Get:2 http://in.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 curl amd64 7.74.0-1ubuntu2.3 [170 kB]
Fetched 175 kB in 0s (581 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 189713 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.2.4ubuntu0.1_all.deb ...
Unpacking apt-transport-https (2.2.4ubuntu0.1) ...
Selecting previously unselected package curl.
Preparing to unpack .../curl_7.74.0-1ubuntu2.3_amd64.deb ...
Unpacking curl (7.74.0-1ubuntu2.3) ...
Setting up apt-transport-https (2.2.4ubuntu0.1) ...
Setting up curl (7.74.0-1ubuntu2.3) ...
Processing triggers for man-db (2.9.4-2) ...

Step 6: Adding GPG key for Docker repo

root@linuxhelp:~# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

Step 7: Adding Docker repo to APT resource

root@linuxhelp:~# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" 

Repository: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable'
Description:
Archive for codename: focal components: stable
More info: https://download.docker.com/linux/ubuntu
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-hirsute.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_ubuntu-hirsute.list
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [11.6 kB]   
Hit:3 http://in.archive.ubuntu.com/ubuntu hirsute InRelease                           
Hit:4 http://in.archive.ubuntu.com/ubuntu hirsute-updates InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu hirsute-backports InRelease
Hit:6 http://security.ubuntu.com/ubuntu hirsute-security InRelease
Fetched 69.3 kB in 1s (64.4 kB/s)
Reading package lists... Done

Step 8: To install from Docker repo instead of Ubuntu repo

root@linuxhelp:~# apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: 5:20.10.9~3-0~ubuntu-focal
  Version table:
     5:20.10.9~3-0~ubuntu-focal 500
        500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages

Step 9: Installing Docker by using the following command

root@linuxhelp:~# apt install docker-ce
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  containerd.io docker-ce-cli docker-ce-rootless-extras docker-scan-plugin git git-man liberror-perl libslirp0 pigz
  slirp4netns
Suggested packages:
  aufs-tools cgroupfs-mount | cgroup-lite git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
  gitweb git-cvs git-mediawiki git-svn
The following NEW packages will be installed:
  containerd.io docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin git git-man liberror-perl
  libslirp0 pigz slirp4netns
0 upgraded, 11 newly installed, 0 to remove and 161 not upgraded.
Need to get 100 MB of archives.
After this operation, 434 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.4.11-1 [23.7 MB]
Get:2 http://in.archive.ubuntu.com/ubuntu hirsute/universe amd64 pigz amd64 2.6-1 [63.6 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu hirsute/main amd64 git-man all 1:2.30.2-1ubuntu1 [931 kB]
Setting up libslirp0:amd64 (4.4.0-1ubuntu0.1) ...

Step 10: Access and Download images from Docker Hub

root@linuxhelp:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete 
Digest: sha256:37a0b92b08d4919615c3ee023f7ddb068d12b8387475d64c622ac30f45c29c51
Status: Downloaded newer image for hello-world:latest

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

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:

 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

By Installation of Docker and run images on Ubuntu 21.04 comes to an end

Tags:
grayson
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What does docker mean?

A

Docker is an open-source containerization platform as a service.

Q

What is a container in Docker?

A

Docker delivers software in packages called containers, which is called docker image.

Q

Why is Docker so fast than VM?

A

Docker is faster than virtual machines.
Because Dockerized apps are that they use resources from the host system in a more efficient manner.

Q

Does Docker packages run in the cloud?

A

Docker image runs in any environment from on-premises Kubernetes to AWS ECS, Azure ACI, Google GKE, and more.

Q

Does Docker support Integrate development tools?

A

Docker works with all development tools you use including VS Code, CircleCI, and GitHub.

Related Tutorials in How to install Docker and run images on Ubuntu 21.04

Related Tutorials in How to install Docker and run images on Ubuntu 21.04

How to install Meld tool in Ubuntu
How to install Meld tool in Ubuntu
Feb 25, 2017
How to install Dconf-Editor on Ubuntu 18.04
How to install Dconf-Editor on Ubuntu 18.04
Jul 14, 2018
How to install and update OpenSSL on Ubuntu 16.04
How to install and update OpenSSL on Ubuntu 16.04
Mar 9, 2017
How to install GLib 2.0 on Ubuntu 17.04
How to install GLib 2.0 on Ubuntu 17.04
May 22, 2017
How to Install Android Emulator on Ubuntu 20.4.1
How to Install Android Emulator on Ubuntu 20.4.1
Jul 13, 2021
How To Install AnyDesk on Ubuntu 16.04
How To Install AnyDesk on Ubuntu 16.04
Apr 4, 2018
How to install Genymotion 2.12.1 on Ubuntu 18.04
How to install Genymotion 2.12.1 on Ubuntu 18.04
Jul 9, 2018
How to install Timeshift 18.4 on Ubuntu 18.04
How to install Timeshift 18.4 on Ubuntu 18.04
Jul 6, 2018

Related Forums in How to install Docker and run images on Ubuntu 21.04

Related Forums in How to install Docker and run images on Ubuntu 21.04

Ubuntu
matthew class=
Failed to enable unit: Refusing to operate on linked unit file sshd.service
Apr 15, 2019
Ubuntu
mason class=
Passwd: You may not view or modify password information for root On Ubuntu 19.04
May 27, 2019
Ubuntu
isaac class=
/etc/apt/sources.list Permission denied
May 18, 2017
Ubuntu
yousuf class=
lsb_release command not working : Debian
Jan 18, 2018
ifconfig command
jackbrookes class=
what is the location of the ifconfig program on your machine?
Jan 4, 2018
Ubuntu
mason class=
"E: Package 'php-mcrypt' has no installation candidate" error on Ubuntu 20.4.1
Mar 15, 2021
NFS
luke class=
clnt_create: RPC: Program not registered
Apr 25, 2017
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018

Related News in How to install Docker and run images on Ubuntu 21.04

Related News in How to install Docker and run images on Ubuntu 21.04

How To Install Mixxx on Ubuntu 16.04
How To Install Mixxx on Ubuntu 16.04
Oct 11, 2017
Ubuntu 17.04 released with greater expectations
Ubuntu 17.04 released with greater expectations
Apr 15, 2017
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Ubuntu Core now available on i.MX6 based TS-4900 thanks to Technologic Systems Inc.
Mar 1, 2017
Docker friendly Alpine Linux gets hardened Node.js
Docker friendly Alpine Linux gets hardened Node.js
Apr 19, 2017
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Ubuntu 17.10 Artful Aardvark Beta 1 is now here. Download Now
Sep 2, 2017
Ubuntu Unity is no more: One Linux dream has been axed
Ubuntu Unity is no more: One Linux dream has been axed
Apr 7, 2017
What’s next for Ubuntu Linux Desktop?
What’s next for Ubuntu Linux Desktop?
Apr 11, 2017
Say Hi to Ubuntu's new mascot
Say Hi to Ubuntu's new mascot
Mar 22, 2019
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help legeek ?
Installation of the call center module

hello

I wish to install a call center in virtual with issabel, I downloaded the latest version of it , but I don' t arrive to install the call center module in issabel. please help me

thanks!

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.