Install Docker on Debian 12 (Bookworm)

How to Install Docker on Debian

Docker is a popular platform for developing, shipping, and running applications inside containers. This guide will show you how to install Docker on a Debian-based system.

Step 1: Update the Package Index and Install Necessary Packages

sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
    

Step 2: Add Docker’s Official GPG Key

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    

Step 3: Set Up the Docker Repository

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    

Step 4: Update the Package Index Again

sudo apt-get update
 
Add docker repo to linux

Step 5: Install Docker Engine, containerd, and Docker Compose

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    

Step 6: Verify the Docker Installation

sudo docker run hello-world
    

Hello world in Docker

If the installation is successful, you should see a message saying "Hello from Docker!" indicating that Docker is installed and running correctly.

Congratulations! You now have Docker installed on your Debian system. Happy containerizing!

Comments

Popular posts from this blog

Unsupervised Learning

Automate Blog Post creation using Blogger APIs and Python

Setting up Python Flask server on internet via Port forwarding

The beginning of Data Quest

Setting up Jupyter Lab integrated with Python, Julia, R on Windows Subsystem for Linux (Ubuntu)