Simple Shortcut to Install Docker in Ubuntu Using Shell Script

I’ve made Shell Script file for install Docker in Ubuntu.

This is the script:

sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
curl -fsSL | sudo apt-key add - 
sudo add-apt-repository \
"deb \
ubuntu-$(lsb_release -cs) \
sudo apt-get update
sudo apt-get -y install docker-engine
# add current user to docker group so there is no need to use sudo when running docker
sudo usermod -aG docker $(whoami)

Just copy and paste the script into your file and save it with .sh file extension. For example, i saved this script as .

And then, you can run this command:


With Github

Just run these commands:

git clone
cd install-docker-ubuntu-shell-script/

See on Github.

Original from