Skip to content

Dreifach-M/Setup_Ubuntu_AWS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Setup Ubuntu AWS

Setup + add swap and instal Docker & docker-compose

01 - Add Swap:

  • check if your instance already has a swap file or partition:
sudo swapon --show
  • Create 1GB swap file called /swapfile. You can adjust the size of the file by changing the number after -l.
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
  • Enable the swap file
sudo swapon /swapfile
  • Add an entry to the /etc/fstab file to ensure that the swap file is automatically enabled after every reboot
/swapfile swap swap defaults 0 0
  • Verify the swap file
sudo swapon --show
free -h

02 - Docker Installation:

  • Update your existing packages
sudo apt update
  • Install a prerequisite packages which let apt utilize HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
  • Add GPG key for the official Docker repo to the Ubuntu system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • Add the Docker repo to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
  • Update the database with the Docker packages from the added repo:
sudo apt update
  • install Docker and Docker compose + Docker CE command line interface + containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
  • Test verify the docker setup:
sudo docker --version
docker compose version
sudo docker run hello-world
sudo docker images
sudo docker ps -a
  • To avoid using sudo for docker activities, add your username to the Docker Group:
sudo usermod -aG docker {your_username}

03 - Install necessary dependencies

sudo apt install -y python3-pip python3-venv python3-dev python3-pandas git curl

About

Setup + add swap and instal Docker & docker-compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors