Skip to main content
In this step-by-step guide, you’ll learn how to install and configure the Docker Engine on an Ubuntu host. By the end of this tutorial, your Ubuntu VM will be ready to run containers and support your Docker-based workflows.

Prerequisites

  • A machine running Ubuntu 16.04 or newer (this example uses Ubuntu 18.04 “Bionic Beaver” on x86_64).
  • A user account with sudo privileges.
Make sure your system is up to date before proceeding. Run sudo apt-get update && sudo apt-get upgrade if you haven’t recently updated your packages.

1. Remove Old Docker Versions

If you have any legacy Docker packages installed, remove them to avoid conflicts:

2. Install Required Packages

Docker’s repository requires HTTPS transport, certificate management, and command-line tools. Update the package index and install these dependencies:

Prerequisite Packages

3. Add Docker’s Official GPG Key

Import Docker’s GPG key to verify package signatures:
Verify the fingerprint to ensure integrity:
If the fingerprint does not match 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, do not continue. Verify your network and retry the key import.

4. Set Up the Docker APT Repository

Add Docker’s stable repository to your system:

5. Install Docker Engine

Refresh the package index and install Docker Engine, CLI, and containerd:

6. Verify the Installation

  1. List installed Docker packages:
  2. Check that the Docker service is active and enabled at boot:

7. View Docker Version and System Information

  • Display the Docker client version:
  • Show detailed version information for both client and server:
  • Inspect system-wide Docker details (containers, images, drivers, plugins):
Congratulations! You now have Docker Engine installed and running on your Ubuntu host. Use this environment to build, ship, and run containerized applications.

Watch Video