Skip to content

Docker Install

Michael_Scopic edited this page Sep 8, 2022 · 7 revisions

Install docker on your EC2 machine or on your own machine

Installing Docker on Linux (the better operating system):

This guide will assume you are using Ubuntu as your Linux distro.

These steps will apply to AWS EC2 instance users!

If you are using a different distro, then look up the install instructions for your distro.

# refresh/update your packages first
sudo apt-get update; sudo apt-get upgrade -y

# install needed tools for docker
sudo apt-get install ca-certificates curl gnupg lsb-release

# makes a directory in "/etc/apt/keyrings"
sudo mkdir -p /etc/apt/keyrings

# adds Docker's GPG key to the directory you just created
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# adds Dockers repository
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# refresh your repositories and packages
sudo apt-get update

# install Docker and its related tools
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

# adds your user to the docker group, so you wont need to prefix docker commands with "sudo"
sudo usermod -aG docker $USER

# reload your user with the new group
exec su - $USER

# done!

Installing Docker on Mac:

Use this link here:

https://docs.docker.com/desktop/mac/install/

You can install the Docker Desktop app through there.

Also I'm pretty sure there isn't the standalone Docker Engine (CLI docker), same thing for Windows users. Sorry :(

Installing Docker on Windows:

This one is a bit more complicated, because Windows is not Unix based unlike Linux and Mac. Therefore you need to install a tool called WSL

Installing WSL 2

WSL (Windows Subsystem for Linux) is an amazing tool that allows you to run Linux commands on Windows systems!

Open PowerShell as admin and enter the following command:

wsl --install

This will first install WSL, and then install Ubuntu as the default distro.

  • Note: you can install a different distro in the Microsoft Store, just search Linux distro you'd like to use.

You should reboot after this command completes successfully.

Setting up Ubuntu for WSL

Once rebooted, hit the super key (the key that usually has the Windows logo on it) and search for "ubuntu". It should show you an app called "Ubuntu".

This will bring up a window which will prompt you for a username. Make sure the username is all lowercase.

When it prompts you for your password, type it in. Note that it will not show what you type for privacy/security reasons.

It will ask you to retype your password to make sure you didn't just have a stroke and forgot it.

Done!

Setting up Docker Desktop

Head to:

https://docs.docker.com/desktop/windows/install/

And follow the directions there.

Finishing up

After you are done installing Docker, you should head here to learn about Docker and the basics of Docker.

You should also head here to learn about Linux/bash basics.

Clone this wiki locally