How to install Docker on Ubuntu 23

So, you’ve decided to dive into the world of containerization with Docker on Ubuntu 23? Great choice! Docker simplifies the process of deploying applications, making your life as a developer or system administrator much easier. In this step-by-step guide, we’ll walk through the installation process, ensuring that even beginners can follow along smoothly.

Prerequisites

Before we start, ensure that you have:

  • A machine running Ubuntu 23.
  • Administrative privileges (you can use sudo).

Step 1: Update Package Lists

Let’s start by updating the package lists to make sure we have the latest information about available packages. Open your terminal and run:

sudo apt update
How to install Docker on Ubuntu 23

Step 2: Install Docker Dependencies

Docker requires some dependencies to be installed. Let’s get those sorted out:

sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
How to install Docker on Ubuntu 23

Step 3: Add Docker GPG Key

Add Docker’s official GPG key to ensure the integrity of the packages:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4: Set Up the Docker Repository

Now, let’s add the Docker repository:

echo "deb [signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5: Install Docker Engine

Finally, let’s install Docker itself:

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose
How to install Docker on Ubuntu 23

Step 6: Verify Docker Installation

Ensure that Docker is installed correctly by running a simple test:

sudo docker run hello-world

If everything is set up properly, you’ll see a welcome message indicating that your Docker installation is working.

Verify Docker on Ubuntu 23 Installation

Congratulations! You’ve successfully installed Docker on your Ubuntu 23 machine. This powerful tool opens up a world of possibilities for managing and deploying applications in containers.

Feel free to explore more Docker commands and experiment with containerized applications. Happy coding!