Skip to content

Instantly share code, notes, and snippets.

@camme
Last active March 8, 2021 07:22
Show Gist options
  • Save camme/3e76d0e4e4c06169a3cc16ce2ee2c050 to your computer and use it in GitHub Desktop.
Save camme/3e76d0e4e4c06169a3cc16ce2ee2c050 to your computer and use it in GitHub Desktop.
install docker and docker-compose
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get update
apt-get install -y \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get install docker-ce -y
sudo apt-get install python-certbot-apache -y
groupadd docker
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# nginx
apt-get install nginx -y
# certbot/letsencrypt OLD
# apt-get update
# add-apt-repository ppa:certbot/certbot
# apt-get update
# apt-get install python-certbot-nginx -y
# remove apache
apt-get purge apache2 apache2-utils apache2-bin apache2.2-common -y
apt-get autoremove -y
# certbot/letsencrypt
snap install core; sudo snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
usermod -aG docker $USER
echo Follow this https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html to mount external volume
echo We will now exit the ssh session...
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment