To install Docker on Ubuntu, follow these steps:
-
Update your existing list of packages:
sudo apt update
-
Install packages to allow apt to use a repository over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
-
Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -
Add the Docker APT repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -
Update the package database with the Docker packages from the newly added repo:
sudo apt update
-
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce
-
Install Docker:
sudo apt install docker-ce
-
Check that Docker is running:
sudo systemctl status docker
-
(Optional) Manage Docker as a non-root user:
sudo usermod -aG docker ${USER}
To install Docker Desktop on Windows, follow these steps:
-
Download Docker Desktop for Windows from the official Docker website.
-
Run the Docker Desktop Installer, which you just downloaded, and follow the installation instructions.
-
Enable WSL 2 if it is not already enabled:
-
Open PowerShell as Administrator and run:
wsl --install
-
-
Start Docker Desktop from the Start menu.
-
Follow the guided onboarding to build your first container.
-
Verify installation:
-
Open PowerShell and run:
docker --version
-
To install Docker Desktop on MacOS, follow these steps:
-
Download Docker Desktop for Mac from the official Docker website.
-
Open the downloaded Docker.dmg file and drag Docker to Applications.
-
Run Docker Desktop from the Applications folder.
-
Follow the installation process and authorize the installer with your system password.
-
Verify installation:
-
Open Terminal and run:
docker --version
-
-
Start using Docker from the Docker menu in the top status bar.
This will set up Docker Desktop on all three platforms: Ubuntu, Windows, and MacOS.