How to Install Docker on Ubuntu 18.04
Learn how to easily install and configure Docker on Ubuntu 18.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.
Learn how to easily install and configure Docker on Ubuntu 22.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.
Written by Fullstacko Team
Docker is a popular containerization platform that allows developers to package applications and their dependencies into lightweight, portable containers. This tutorial will guide you through the steps to install Docker on an Ubuntu 22.04 system.
Before proceeding with the installation, ensure you have the following:
To ensure that your system has the latest package information, update the local package index:
sudo apt update
Docker requires some dependencies to be installed first. These ensure secure and efficient package downloads and system compatibility:
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
apt-transport-https
: Enables APT to fetch packages over HTTPS for secure downloads.ca-certificates
: Ensures trusted certificates for secure communication.curl
: A command-line tool used to transfer data from URLs.software-properties-common
: Provides scripts for managing software sources.To verify the authenticity of the Docker packages, add the GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
This step ensures that the packages you download are signed by Docker and have not been tampered with.
Next, add the Docker APT repository to your system:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Now, update the package list again and install Docker:
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y
docker-ce
: The core Docker Engine package.docker-ce-cli
: The command-line tool to interact with Docker.containerd.io
: A container runtime that handles container lifecycle operations independently from the Docker daemon, improving stability and efficiency.Once installed, check the Docker service status:
sudo systemctl status docker
You should see output indicating that Docker is running. To further verify, run the following command:
docker --version
This should display the installed Docker version.
By default, Docker requires root privileges. To allow your user to run Docker without sudo, add it to the Docker group:
sudo usermod -aG docker $USER
Then, log out and log back in for the changes to take effect.
You have successfully installed Docker on Ubuntu 22.04. You can now start using Docker to create and manage containers on your system. For further reading, check out Docker’s official documentation.
Other tutorials from our collection that you might want to read next.
Learn how to easily install and configure Docker on Ubuntu 18.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.
Learn how to easily install and configure Docker on Ubuntu 20.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.
Learn how to easily install and configure Docker on Ubuntu 24.04 with step-by-step instructions. Get your system ready for containerization with this simple tutorial.
Get curated weekly analysis of vital developments, ground-breaking innovations, and game-changing resources in your industry before everyone else. All in one place, all prepared by experts.