-
Notifications
You must be signed in to change notification settings - Fork 0
Docker installation
This page will guide you through a simple Docker installation. Please make sure that you have administrative privileges on your device before installing.
Prior to installing the Docker desktop, make sure you’ve installed and enabled Windows Sub-system for Linux version 2 (WSL2) as it is needed to run a Linux-based container on a Windows machine.
-
On your search bar, look for “Windows PowerShell” right click and choose “Run as administrator”
-
Install WSL2 by entering the command
wsl --install
wsl --install
This command will enable the features necessary to run WSL and install the Ubuntu distribution of Linux. Follow the prompt to create Ubuntu user.
-
Restart your machine
-
After restart, open Windows PowerShell again and check the installation by entering the command.
wsl -l -v # NAME STATE VERSION # Ubuntu Running 2
If You see Ubuntu is installed with WSL version 2, you can proceed to install Docker Desktop.
- Download the installer from https://docs.docker.com/desktop/install/windows-install/.
Note
In most cases, if you’re using Intel or AMD CPU, choose the x86_64 version. Otherwise if you’re using an Arm CPU i.e. Snapdragon, please use Arm (Beta) version.
- Double-click Docker Desktop Installer.exe to run the installer.
- Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
- Start the Docker Desktop by searching for Docker and select Docker Desktop in the search results.
- Accept the terms and conditions
- Docker Desktop starts after you accept the terms.
- Download the installer from https://docs.docker.com/desktop/install/mac-install/ using the download buttons. Make sure you have the right version according to your device’s processor (Apple silicon or Intel chip).
- Double-click
Docker.dmg
to open the installer, then drag the Docker icon to the Applications folder. - Double-click
Docker.app
in the Applications folder to start Docker. - Accept the terms and conditions
- From the installation window, select “Use recommended settings” (Requires password). This lets Docker Desktop automatically set the necessary configuration settings.
- Select Finish.
Docker provides a convenience script at https://get.docker.com/ to install Docker into development environments non-interactively.
Supported distributions
- Ubuntu
- Debian
- Fedora
- Red Hat Enterprise Linux
Note
Before installing, make yourself familiar with potential risks and limitations of the convenience script:
- The script requires root or
sudo
privileges to run. - The script attempts to detect your Linux distribution and version and configure your package management system for you.
- The script doesn't allow you to customize most installation parameters.
- The script installs dependencies and recommendations without asking for confirmation.
- By default, the script installs the latest stable release of Docker.
- The script isn't designed to upgrade an existing Docker installation.
To install with convenience script, open the terminal and run the following commands:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
These optional post-installation procedures are optional but will help to configure your Linux host machine to work better with Docker.
By default only the root user can access the Docker as it requires administrative privileges to run, other users can only access it using sudo
.
If you don't want to preface the docker command with sudo
, create a Unix group called docker and add users to it.
To create the docker group and add your user:
-
Create the docker group.
sudo groupadd docker
Note: On some Linux distributions, the system automatically creates this group.
-
Add your user to the docker group.
sudo usermod -aG docker $USER
-
Log out and log back in so that your group membership is re-evaluated.
-
Verify that you can run docker commands without
sudo
.docker run hello-world