Programming

How to install Docker and Setup Docker on Debian based linux ( Without GUI) ?

How to install Docker and Setup Docker on Debian based linux ( Without GUI) ?
zlaam

zlaam

July 3, 2026·1 views

1. Remove old Docker packages (if installed)

sudo apt remove docker.io docker-compose docker-compose-v2 docker-doc podman-docker containerd runc

2. Update packages

sudo apt update
sudo apt install -y ca-certificates curl

3. Add Docker's official GPG key

sudo install -m 0755 -d /etc/apt/keyrings

sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
-o /etc/apt/keyrings/docker.asc

sudo chmod a+r /etc/apt/keyrings/docker.asc

4. Add the Docker repository

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
  https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo $VERSION_CODENAME) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update

5. Install Docker Engine and CLI

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

This installs:

  • Docker Engine
  • Docker CLI
  • Containerd
  • Docker Buildx
  • Docker Compose v2

6. Verify installation

sudo systemctl status docker

If it's not running:

sudo systemctl enable --now docker

8. (Optional) Run Docker without sudo

sudo usermod -aG docker $USER
newgrp docker

After this you must need to logout the system and login again if that didn't work reboot will definately work

Thank you

zlaam

zlaam

Author

Comments (0)

You need to be logged in to post comments

No comments yet. Be the first to share your thoughts!