Proyectos programación

Installing Docker on Linux – Ubuntu


What is a container?

A container is a sandboxed process running on a host machine that is isolated from all other processes running on that host machine. 

That isolation leverages kernel namespaces and groups, features that have been in Linux for a long time. Docker makes these capabilities approachable and easy to use. 

To summarize, a container:

  • Is a runnable instance of an image. You can create, start, stop, move, or delete a container using the Docker API or CLI.
  • Can be run on local machines, virtual machines, or deployed to the cloud.
  • Is portable (and can be run on any OS).
  • Is isolated from other containers and runs its own software, binaries, configurations, etc.

If you’re familiar with chroot, then think of a container as an extended version of chroot. The filesystem comes from the image. However, a container adds additional isolation not available when using chroot.

What is an image?

A running container uses an isolated filesystem. This isolated filesystem is provided by an image, and the image must contain everything needed to run an application – all dependencies, configurations, scripts, binaries, etc. The image also contains other configurations for the container, such as environment variables, a default command to run, and other metadata.



To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:

  • Ubuntu Mantic 23.10
  • Ubuntu Jammy 22.04 (LTS)
  • Ubuntu Focal 20.04 (LTS)

Docker Engine for Ubuntu is compatible with x86_64 (or amd64), armhf, arm64, s390x, and ppc64le (ppc64el) architecture

Before you can install Docker Engine, you need to uninstall any conflicting packages.

Run the following command to uninstall all conflicting packages:

Install Docker 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.

Install the Docker packages.

Verify that the Docker Engine installation is successful by running the hello-world image.

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

You have now successfully installed and started Docker Engine.

Install Docker Compose

Use the following command to download:

To verify that the installation was successful, you can run:

Docker Compose is now successfully installed on your system. In the next section, you’ll see how to set up a docker-compose.yml file and get a containerized environment up and running with this tool.

How to completely uninstall docker