Debian - Install docker

By xngo on October 1, 2019

Install Docker

# Add dependent packages.
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
 
# Add Docker’s official GPG key.
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
 
# Add Docker’s repository to apt-get.
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
 
# Update list of packages of Docker’s repository.
apt-get update
 
# Install Docker.
apt-get install -y docker-ce docker-ce-cli containerd.io

Test docker

docker run hello-world

Output

Docker - Run hello-world - Output

Reference

  • https://docs.docker.com/install/linux/docker-ce/debian/

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.