To install Docker on your system, follow these steps based on your operating system:
For Ubuntu
-
Update your package index:
sudo apt update -
Install required packages:
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 repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" -
Update the package index again:
sudo apt update -
Install Docker:
sudo apt install docker-ce -
Verify Docker installation:
docker --version
For Windows
-
Download Docker Desktop:
Visit the Docker Desktop for Windows page and download the installer. -
Run the installer:
Follow the installation wizard and ensure that the "Install required Windows components for WSL 2" option is checked. -
Start Docker Desktop:
After installation, launch Docker Desktop from the Start menu. -
Verify installation:
Open a command prompt and run:docker --version
For macOS
-
Download Docker Desktop:
Go to the Docker Desktop for Mac page and download the installer. -
Install Docker:
Open the downloaded.dmgfile and drag the Docker icon to your Applications folder. -
Start Docker Desktop:
Launch Docker from your Applications folder. -
Verify installation:
Open a terminal and run:docker --version
Post-Installation Steps
After installing Docker, it's a good idea to manage Docker as a non-root user. You can do this by adding your user to the Docker group:
sudo usermod -aG docker $USER
Log out and back in for the changes to take effect.
Further Learning
For more detailed instructions and troubleshooting, you can refer to the official Docker documentation: Get Docker.
If you have any questions or need further assistance, feel free to ask!
