dockerdocker

Install docker aws ec2

(Depending on the OS you would run different commands,arrow-up-right I will be using t3-mini ubuntu from aws)

Setup docker apt repository

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

Install latest package

Verify installation

You should see some output like this:

Remove some service

To completely remove some service from Docker (containers, images, volumes, and networks), follow these steps: (replace service_name with your service, for example kali-linux, appflowy, whatever)



πŸ” Tip: Before executing, you can check what will be removed by running the commands without the last part. Example:

This will show the images without deleting them.

Favorite commands

Disk space

This command shows the total disk space used by Docker on your EC2 instance, with a breakdown of images, containers, volumes, layers, and any host bind-mounts.

Example Output

Last updated