How to Install Docker on Ubuntu
Docker is an open-source platform that allows you to build, package, and deploy applications as containers.
While Docker can be installed together with Ubuntu, if your Ubuntu system doesn't have Docker installed, you can follow these steps to install Docker on an Ubuntu system.
Below are the steps to install Docker on an Ubuntu system.
Step 1: Install using the apt repository
Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
- Add Docker's official GPG key:
- Add the repository to Apt sources:
Step 2: Install the latest version Docker packages
To install the latest version, run:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 3: Verify that the Docker Engine installation is successful
Running the hello-world image to verify that the Docker Engine is installed
sudo docker run hello-world
You will see these lines on your screen if the Docker is installed correctly:
When the container runs, it prints a confirmation message and exits.
You have now successfully installed and started Docker Engine!
Do you enjoy this blog post?