Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install Docker In Debian 9 (Stretch)
# -----------------------
# This is a script that installs docker-ce (Docker Community Edition) on Debian 9
# Inspired by
# -----------------------
# Pre-requesite
sudo apt-get -y remove docker docker-engine
# Docker Setup (repo)
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates wget software-properties-common
sudo apt-key add gpg
echo "deb [arch=amd64] $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-cache policy docker-ce
# Install Docker
sudo apt-get -y install docker-ce
# Start Docker
sudo systemctl start docker
# Enable Docker service on boot
sudo systemctl enable docker
# Create a group "docker"
sudo groupadd docker
# Add user to group "docker"
sudo gpasswd -a $USER docker
# Restart Docker
sudo systemctl restart docker
Copy link

AliTool commented Jun 17, 2018

could you please add "newgrp docker" at the end of the script to refresh user permission on the group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment