Skip to main content

Docker Installation on Windows

Install Docker Engine

Follow the official manual for installing Docker engine.

Steps to Install

  1. Install "Containers feature":

    Install-WindowsFeature -Name Containers
  2. Download the static binary archive with the desired version.

  3. Extract the archive in PowerShell:

    Expand-Archive /path/to/<FILE>.zip -DestinationPath $Env:ProgramFiles
  4. Register the service and start the Docker Engine:

    &$Env:ProgramFiles\Docker\dockerd --register-service
    Start-Service docker
  5. Verify that Docker engine is installed correctly:

    docker version
tip

If docker commands don't work, ensure the Docker path is added to the "PATH" environment variable, or use docker.exe commands instead.

Install Docker Compose Plugin

Follow the manual.

Steps to Install

  1. Download the latest release:

    Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.34.0/docker-compose-windows-x86_64.exe" -Destination $Env:ProgramFiles\Docker\docker-compose.exe
  2. Verify installation:

    docker-compose version

Aliases

Creating aliases for frequently used commands can save time. You need to create a profile.ps1 file in the Windows PowerShell installation location, usually C:\Windows\System32\WindowsPowerShell\v1.0.

info

These aliases provide shortcuts for common Docker operations.

Recommended aliases:

function dps { docker.exe ps --format "table {{.Names}}`t{{.Status}}`t{{.Ports}}" | ForEach-Object { $_ -replace "0.0.0.0:", "" -replace "/tcp", "" -replace ":", "" }}

function dcp { docker-compose pull }
function dcu { docker-compose up -d }
function dcd { docker-compose down }

function dlog { param ($container) docker.exe logs $container }
function dlogt { param ($container) docker.exe logs --tail 1000 $container }

You can use this PowerShell script to create the profile file:

Set-Content -Path "C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1" -Value @'
function dps { docker.exe ps --format "table {{.Names}}`t{{.Status}}`t{{.Ports}}" | ForEach-Object { $_ -replace "0.0.0.0:", "" -replace "/tcp", "" -replace ":", "" }}

function dcp { docker-compose pull }
function dcu { docker-compose up -d }
function dcd { docker-compose down }

function dlog { param ($container) docker.exe logs $container }
function dlogt { param ($container) docker.exe logs --tail 1000 $container }
'@ -Encoding UTF8
warning

Creating the profile file in the system PowerShell location requires administrator privileges.