ssh ubuntu@{ip}
Enter yes to prompt
sudo adduser {username}
and follow prompts
sudo mkdir /home/{username}/.ssh
cd /home/{username}/.ssh
sudo touch authorized_keys
sudo vim authorized_keys
Paste your .ssh/id_rsa.pub key from your laptop into this file
:wq
to leave vim
cd ..
to leave .ssh folder
sudo chown -R {username}:{username} .ssh
exit
ssh {username}@{ip}
exit
ssh root@{ip}
// Get back in as root
sudo usermod -aG sudo {username}
su - {username}
// switch to new account
sudo ls -lah /root
// smoke test sudo capabilities
exit
exit
ssh {username}@{ip}
https://docs.docker.com/install/linux/docker-ce/ubuntu/#os-requirements
Add docker to sudo group:
sudo usermod -aG docker ubuntu
exit
- log back into ec2 instance
id -nG
- Smoke test:
docker ps
https://docs.docker.com/compose/install/#install-compose
- Smoke test:
docker-compose --version
ssh-keygen -t rsa -b 4096 -C “{email}”
// just stick with defaults
cat /home/{username}/.ssh/id_rsa.pub
// smoke test new key
Clone down your GH Repository, CD into it and:
docker-compose up --build -d
- Smoke test:
curl localhost:{port}
sudo apt install nginx
- Smoke test:
sudo systemctl status nginx
cd /etc/nginx/sites-available
sudo touch {name}
sudo vim {name}
Paste in this:
server {
listen 80;
server_name {url};
client_max_body_size 100m;
client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads
location / {
proxy_pass http://localhost:{PORT};
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
sudo cp {name} ../sites-enabled/
sudo nginx -t
// smoke test the new config file we made
sudo service nginx reload
Smoke test by going to your {ip}
(Before getting SSL certs you need to point your domain name to EC2 instance) Install Certbot:
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get install python-certbot-nginx
- Make sure to open up port 80 in AWS Security Group
sudo certbot --nginx -d {url}
Yes for redirectsudo systemctl restart nginx
sudo ufw status
sudo ufw allow 'Nginx Full'
sudo ufw status
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
source .bashrc
nvm install --lts