How to Install Docker on Ubuntu: Step-By-Step Guide [2025]

FI
Kubernetes

Share Post Now :

HOW TO GET HIGH PAYING JOBS IN AWS CLOUD

Even as a beginner with NO Experience Coding Language

Explore Free course Now

Table of Contents

Loading

Docker is an open-source tool that uses containers to make it easier to create, deploy, and run applications. Docker is the best container orchestration tool, and most large corporations now use it to deploy applications.

The first step in learning about docker is to install it. This blog post covers step by step overview of how to install docker on Ubuntu.

  1. Docker Install Overview
  2. Install  Docker On Ubuntu
  3. Frequently Asked Questions

Docker Install Overview ^

Docker is a free and open platform for developing, shipping, and running apps. Docker allows you to decouple your applications from your infrastructure, allowing you to release software faster. Docker enables you to manage your infrastructure in the same way you manage your applications. By utilising Docker’s methodology for fast shipping, testing, and deploying code, you can drastically reduce the time between writing code and executing it in production.

How To Practice Docker

There are three ways to practice Docker-
a) First is Sandbox in this, you will get a 4 hour free Docker environment per day by Play With Docker which is sponsored by Docker.
b) The second and recommended method is You can create a Ubuntu Virtual Machine on a Free Azure account or on a Free AWS account and then proceed with installing Docker.
c) The third method is to on your On-premise Desktop/Laptop.
Play With Docker homepage

How to Install Docker on ubuntu  ^

To get started with Docker Engine on Ubuntu, make sure your system meets the prerequisites, then install Docker.

System Requirements

  • For an installation of  Docker Engine, you need the 64-bit Ubuntu version.
  • One Ubuntu server set up with a non-root user with Sudo privileges and a basic firewall.

Steps for Installing Docker On ubuntu

1. First Update Software Repositories:

$ sudo apt-get update -y

2. Uninstall Previous Docker Versions (Only if Docker was previously installed on this host and you want to configure it again):

$ sudo apt-get remove docker docker-engine docker.io containerd runc

3. Update the apt package index and install packages to enable apt to use an HTTPS repository:

$ sudo apt-get update
$ sudo apt-get install \
 ca-certificates \
 curl \
 gnupg \
 lsb-release

4. Add the official GPG key for Docker:

$ sudo mkdir -m 0755 -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

5. To configure the stable repository, run the following command. Add the words nightly or test (or both) after the word stable in the commands below to add the nightly or test repository:

echo \ 
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ 
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

6. Make sure everything is up-to-date & Install Docker Engine:

$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

7. Start and Enable Docker:

$ sudo systemctl start docker
$ sudo systemctl enable docker

8. Check Docker status:

$ sudo systemctl status docker

9. Check the Docker version and Docker Compose version:

$ docker --version 
$ docker compose version

Awesome, you have just installed Docker on Ubuntu successfully!

Frequently Asked Questions ^

How does running a Linux container on a Linux machine differ from running a Linux container on a Windows machine?

Running a Linux container on a Linux machine differs from running it on a Windows machine primarily in terms of networking and storage. The container's behavior remains consistent across platforms. However, enterprises and developers typically prefer Linux host machines over Windows due to their higher reliability, developer-friendliness, and security.

What is the difference between Docker Desktop's Stable and Edge versions?

Docker Desktop's Stable Version provides a release-ready installer that is fully tested and reliable, including the most recent Docker Engine release, with a release schedule synchronized with Docker Engine and patch releases. The Edge Version, in contrast, includes new, experimental features that are not fully tested. Although using the Edge Version may result in bugs, crashes, and other issues, it allows users to preview new functionalities, experiment, and provide feedback as Docker Desktop evolves.

Where can I install Docker?

Docker can be installed on various platforms, including on-premise environments, cloud services such as Azure, Oracle Cloud, AWS, Google, and on laptops or desktops.

What are the supported operating systems for Docker?

The supported operating systems for Docker installation are Linux, macOS, and Windows.

How do I install Docker on Windows 11 Home?

To install Docker on Windows 11 Home, you can use Docker Toolbox or Docker Desktop.

Related/References

Join FREE Masterclass on Kubernetes

Discover the power of Kubernetes, Docker, and DevOps – join our free masterclass. Unlock the secrets of Kubernetes, Docker, and DevOps in our exclusive, no-cost masterclass. Take the first step towards building highly sought-after skills and securing lucrative job opportunities. Click on the image below to register for our FREE masterclass now!

Mastering kubernetes content upgrade

Picture of mike

mike

I started my IT career in 2000 as an Oracle DBA/Apps DBA. The first few years were tough (<$100/month), with very little growth. In 2004, I moved to the UK. After working really hard, I landed a job that paid me £2700 per month. In February 2005, I saw a job that was £450 per day, which was nearly 4 times of my then salary.