Skip to content

Instantly share code, notes, and snippets.

@AlexandroPerez
Created March 11, 2018 11:55
Show Gist options
  • Save AlexandroPerez/85bfcd1083049635a405e176cd4e1ea8 to your computer and use it in GitHub Desktop.
Save AlexandroPerez/85bfcd1083049635a405e176cd4e1ea8 to your computer and use it in GitHub Desktop.
Script for installing latest nginx and node LTS. Can be used as a Vagrant provision script, or as a Google Cloud Startup Script
echo "Adding nginx deb and deb-src packages to /etc/apt/sources.list"
echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list
echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list
echo "Downloading nginx_signing.key..."
curl -Os https://nginx.org/keys/nginx_signing.key
echo "Adding it to the apt program keyring"
apt-key add ./nginx_signing.key
echo "Installing nginx..."
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y install nginx
echo "Done"
echo "Installing node 8.x LTS"
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y nodejs
echo "Done"
echo 'PS1="${debian_chroot:+($debian_chroot)}\\n\\e[36mVagrant:\\e[32m\\u@\\h \\e[33m\\w\\e[0m\\n$ "' >> /home/ubuntu/.bashrc
echo 'PS1="${debian_chroot:+($debian_chroot)}\\n\\e[36mVagrant:\\e[31m\\u\\e[32m@\\h \\e[33m\\w\\e[0m\\n$ "' >> /root/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment