Docker can be installed either using Docker Desktop (a graphical user interface application) or via the command line. Windows and macOS users will use Docker Desktop, while Linux users typically install Docker through the command line.
-
Download Docker Desktop for Windows
- Go to the Docker website and download the Docker Desktop installer.
- Ensure your system meets the necessary requirements, particularly for Windows 10 and 11 versions.
-
Install Docker Desktop
- Run the installer and follow the on-screen instructions.
- Docker Desktop requires certain permissions during installation.
-
Configure and Run Docker Desktop
- After installation, launch Docker Desktop. It may take a few minutes to initialize.
- A Docker icon in the system tray indicates that Docker Desktop is running.
-
Verify Installation
- Open a command prompt or PowerShell and type
docker --version
. - Run
docker run hello-world
to ensure Docker can pull and run images.
- Open a command prompt or PowerShell and type
-
Download Docker Desktop for macOS
- Visit the Docker website and download Docker Desktop for macOS.
- Check for any specific macOS version requirements.
-
Install and Run Docker Desktop
- Open the downloaded
.dmg
file and drag Docker to the Applications folder. - Run Docker from the Applications folder; it will initialize on the first launch.
- Open the downloaded
-
Verify Installation
- Open Terminal and type
docker --version
. - Test with
docker run hello-world
.
- Open Terminal and type
Note: While it's possible to run Docker on Windows or macOS without Docker Desktop, it's a bit more complicated and this guide will not cover that setup.
-
Update Software Repositories
- Open Terminal and update package lists with
sudo apt-get update
- Open Terminal and update package lists with
-
Install Docker
- Install Docker using
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Install Docker using
-
Manage Docker Service
- Start Docker using
sudo systemctl start docker
- Enable Docker on boot with
sudo systemctl enable docker
- Start Docker using
-
Add User to Docker Group (Optional)
- Add your user to the Docker group with
sudo usermod -aG docker $USER
- Log out and back in to apply changes.
- Add your user to the Docker group with
-
Verify Installation
- Run
docker --version
. - Test Docker with
docker run hello-world
.
- Run