How do I Install Docker in Ubuntu Server 22.04 Ubuntu Server 22.04

Docker 101: How do I Install Docker in Ubuntu Server 22.04 Ubuntu Server 22.04

In this Docker 101 article, Jack Wallen walks you through the steps to install the most recent version of the Docker container runtime engine on Ubuntu Server 22.04.

As compared to other solutions, Docker is more user-friendly. It also comes with a comprehensive range of options GUI programs (so you don’t need to work on your command prompt) and is available on Linux, macOS, and Windows.

I’ve successfully deployed hundreds of applications and services using this tool and have found it an indispensable part of my routine. In many instances, deploying the application as a container with Docker is faster and more reliable than manually deploying the same application or service.

Do you know how to set up Docker for Linux? Linux?

I’ll demonstrate how to accomplish this, and I’ll demonstrate it on Ubuntu Server 22.04. This means the procedure will work with every Ubuntu (or Debian) based distribution. In the case of Red Enterprise Linux or other distributions (such as Rocky Linux, AlmaLinux, CentOS Stream as well as Feodra Linux) are concerned, these platforms have switched towards Podman to be their primary container runtime, and installing Docker is not just complicated but also tends to cause more damage than it repairs.

If RHEL-based distributions are your thing, leave them to your devices and stick to Podman. But, if Ubuntu-based distributions are what you go, Docker is not only accessible, but it’s also straightforward to install. In this regard, I’ll show you the installation process on Ubuntu Server 22.04. You’ll require a Ubuntu distribution and the sudo user to follow along.

Ready? Let’s start the installation.

Installing on Ubuntu

Include the repository you need

The first step is to log into the Ubuntu instance and add the repository you need (as this version of Docker available in the default repository isn’t the most current version we’d like for our community). Once you’ve registered, you can add a Docker GPG key that is the official Docker GPG key using the command:

curl -fsSL | sudo gpg –de armor -o /usr/share/keyrings/docker-archive-keyring.gpg

Then, you can make sure to add Docker’s official repository: Docker repository:

echo “deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] $(lsb_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install the dependencies that are required

Next, we’ll install the needed dependencies by using the command:

sudo apt-get install apt transport-https ca-certificates curl GnuPG curl LSB-release lsb-release

Install Docker

Last but not least, update apt, and then install Docker using these commands:

sudo apt-get update sudo apt-get install docker-ce docker-ce-cli -y

Join your user in the Docker group.

To be able to make use of Docker without needing to invoke it via sudo (which could cause security issues), it is necessary to add your user’s name to the docker group using:

sudo usermod -aG docker $USER

Log out and then log back in to allow the changes to take effect.

Docker is now ready to be used for the Ubuntu machine.

Test the installation

When Docker is installed, it can confirm the installation by using the command:

docker version

In the output, you will be able to see this:

Server Docker Engine Community Engine Version: 20.10.14

Make sure that your user can execute the Docker command by dragging down the hello-world images using:

Docker pull hello-world

Suppose the image pulls it; congrats! Docker is now installed and ready to begin. The next time you’ll be able to install your first container using Docker.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.