Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Docker In Debian 9 (Stretch)
#!/bin/bash
#
# -----------------------
#
# This is a script that installs docker-ce (Docker Community Edition) on Debian 9
# Inspired by https://gist.github.com/frgomes/a6f889583860f5b330c06c8b46fa0f42
#
# -----------------------
# Pre-requesite
sudo apt-get -y remove docker docker-engine docker.io
# Docker Setup (repo)
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates wget software-properties-common
wget https://download.docker.com/linux/debian/gpg
sudo apt-key add gpg
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(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
@AliTool

This comment has been minimized.

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
You can’t perform that action at this time.