Skip to content

Latest commit

 

History

History
executable file
·
80 lines (66 loc) · 1.7 KB

002-initial-setup-amazon-ec2-ubuntu-instance.md

File metadata and controls

executable file
·
80 lines (66 loc) · 1.7 KB

Initial setup of Amazon EC2 Ubuntu instance

  1. Install aptitude, and update system:
sudo apt-get install -y aptitude
sudo aptitude update
sudo aptitude upgrade -y
  1. Reboot instance:
sudo shutdown -r now
  1. Install essential packages (some might be already installed):
sudo aptitude install -y git \
  python2.7-dev python2.7 \
  wget curl \
  build-essential \
  screen \
  ufw \
  rsync
  1. Create local temp directory:
mkdir ~/temp
  1. Make sure Python is available via the python command:
sudo ln -s /usr/bin/python2.7 /usr/bin/python

  1. Install pip for Python:
cd ~/temp
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
rm -rf get-pip.py

6.5. Install pip3:

curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3
  1. Install glances monitoring tool:
sudo pip install glances
  1. Enable 4GB Swap partition (see original instructions):
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=4096
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1
  1. Enable Swap partition during boot. To update /etc/fstab file, run:
echo "/var/swap.1   swap    swap    defaults        0   0" | sudo tee -a /etc/fstab
  1. Reboot instance:
sudo shutdown -r now
  1. Configure rules for ufw, and enable it:
sudo ufw allow 22   # enable SSH
sudo ufw allow 873  # enable rsync
sudo ufw enable