Skip to content

Instantly share code, notes, and snippets.

@shinnida220
Forked from mslinn/install.sh
Last active July 22, 2022 23:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shinnida220/3b9d79d0d18b170bda2b13dddbc25ad5 to your computer and use it in GitHub Desktop.
Save shinnida220/3b9d79d0d18b170bda2b13dddbc25ad5 to your computer and use it in GitHub Desktop.
Install AWS Cloud9 (with AWS CLI & Docker) on an Ubuntu 20.04 server external to AWS
# Log into your Ubuntu machine then follow these directions
# First allow Cloud9 to ssh to your machine using your account:
# https://docs.aws.amazon.com/cloud9/latest/user-guide/create-environment-ssh.html
# Install required dependencies
if [ -z `which virtualenv` ]; then
sudo pip install virtualenv
fi
if [ -z `apt -qq list libevent-dev 2> /dev/null | grep installed` ]; then
yes | sudo apt install libevent-dev
fi
# Manually install Cloud9 in ~/.c9, use one of the commands below
# From https://docs.aws.amazon.com/cloud9/latest/user-guide/installer.html - Use one of the commands below
curl -L https://d3kgj69l4ph6w4.cloudfront.net/static/c9-install.sh | bash
curl -L https://raw.githubusercontent.com/c9/install/master/install.sh | bash
wget -O - https://raw.githubusercontent.com/c9/install/master/install.sh | bash
# You might want install AWS-SAM-CLI with instructions from this link
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html
# Now visit https://console.aws.amazon.com/cloud9 and have fun with Cloud9
# INSTALL DOCKER ON UBUNTU 20. (Reference - https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-20-04)
First, update your existing list of packages:
`sudo apt update`
Next, install a few prerequisite packages which let apt use packages over HTTPS:
`sudo apt install apt-transport-https ca-certificates curl software-properties-common`
Then add the GPG key for the official Docker repository to your system:
`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -`
Add the Docker repository to APT sources:
`sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"`
This will also update our package database with the Docker packages from the newly added repo.
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
`apt-cache policy docker-ce`
You’ll see output like this, although the version number for Docker may be different:
Output of apt-cache policy docker-ce
docker-ce:
Installed: (none)
Candidate: 5:19.03.9~3-0~ubuntu-focal
Version table:
5:19.03.9~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 20.04 (focal).
Finally, install Docker:
`sudo apt install docker-ce`
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it’s running:
`sudo systemctl status docker`
The output should be similar to the following, showing that the service is active and running:
Output
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-05-19 17:00:41 UTC; 17s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 24321 (dockerd)
Tasks: 8
Memory: 46.4M
CGroup: /system.slice/docker.service
└─24321 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
INSTALL AWS-CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
INSTALL AWS SAM CLI (Ref -https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install-linux.html)
1. Download AWS CLI ZIP with curl/wget
`curl https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip`
2. Unzip the installation files into the sam-installation/ subdirectory.
`unzip aws-sam-cli-linux-x86_64.zip -d sam-installation`
3. Install the AWS SAM CLI.
`sudo ./sam-installation/install`
4. Verify the installation.
`sam --version`
On successful installation, you should see output like the following:
SAM CLI, version 1.18.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment