Skip to content

Instantly share code, notes, and snippets.

@elklein96
Last active July 19, 2018 20:46
Show Gist options
  • Save elklein96/5a563bf0ae6810fe559597e7a46e9b84 to your computer and use it in GitHub Desktop.
Save elklein96/5a563bf0ae6810fe559597e7a46e9b84 to your computer and use it in GitHub Desktop.
Script for installing Node and Docker on Ubuntu
#!/bin/bash
sudo apt-get update
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
mkdir ~/.npm-packages
npm config set prefix ~/.npm-packages
printf "\n*************************\n Node.js version %s is installed! \n*************************\n" $(node -v)
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-cache policy docker-ce
sudo apt-get update
sudo apt-get install -y docker-ce
sudo usermod -aG docker $(whoami)
printf "\n*******************************************************\n"
printf " Docker version %s is now installed!" $(docker version --format '{{.Server.Version}}')
printf "\n Make sure to log out for all changes to take effect"
printf "\n*******************************************************\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment