How to install Docker on Ubuntu

#Introduction

In this tutorial, How to install Docker on Ubuntu 21.04. Docker is an open platform that allows you to build, test, and deploy applications quickly. It’s helpful you less time-consuming to deploy, build tests for your Application

Prerequisites

  • A system running Ubuntu 21.04
  • A user account with sudo privileges

Step 1: Update your system

Update your existing packages:

sudo apt update
How to install Docker on Ubuntu

Step 2: Install curl package

sudo apt install curl -y
install curl on Ubuntu

Step 3: Download the Latest Docker Version

curl -fsSL https://get.docker.com -o get-docker.sh
install docker on ubuntu

Step 4: Install Docker

sh get-docker.sh
install docker

Step 5: To make sure that the current user can access the docker daemon

To avoid using sudo for docker activities, add your username to the Docker Group

sudo usermod -aG docker $USER

Step 6: Check Docker Version

To verify the installation, check the Docker version by command below:

docker --version
Check version docker

Uninstall Docker on Ubuntu

Check package installed docker on Ubuntu.

dpkg -l | grep -i docker

Use apt remove command to uninstall Docker on Ubuntu.

sudo apt-get purge docker-ce docker-ce-cli docker-ce-rootless-extras docker-scan-plugin
sudo rm -rf /var/lib/docker

Remove Software Dependencies

sudo apt autoremove

Conclusion

You have to install Docker on Ubuntu 21.04. I hope will this your helpful. Thank you for reading the DevopsRoles page!

,

About HuuPV

My name is Huu. I love technology and especially Devops Skill such as Docker, vagrant, git so forth. I likes open-sources. so I created DevopsRoles.com site to share the knowledge that I have learned. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →