Installation of Docker for Ubuntu (Linux) Users
This is a step-by-step tutorial on how to install Docker on a Linux operating system. Docker is an open-source technology that allows you to create, run, test, and deploy distributed applications inside software containers.
A Linux distribution (such as Ubuntu, Debian, CentOS, etc.)
Superuser (root) access to your machine
This guide will use Ubuntu as an example, but the process is similar for most Linux distributions.
Step 1: Update Package Lists for Upgrades and New Installations
Open a terminal window.
Update your existing list of packages by typing the following command and pressing enter:
sudo apt update
Step 2: Install Pre-Requisite Packages
Install the necessary packages that allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Step 3: Add Docker's GPG Key
Download the Docker's official GPG key with this command:
curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo apt-key add -
Step 4: Add Docker Repository
Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] <https://download.docker.com/linux/ubuntu> $(lsb_release -cs) stable"
Step 5: Update the Package Database with Docker Packages
Update the package database again:
sudo apt update
Step 6: Install Docker
Now you can install Docker with the command:
sudo apt install docker-ce
Step 7: Verify the Docker Installation
Verify Docker installation by running the Docker hello-world image:
sudo docker run hello-world
The output should look something like this:
If you see the "Hello from Docker!" message, congratulations! You have successfully installed and run a test Docker container on your Linux machine.
If you face any difficulties during the installation, please refer to Docker's official documentation or feel free to ask for assistance.