How to Install Docker Compose on Windows Server 2016

If you ever try to use Docker Compose on Windows Server 2016 you will find out that it is not installed by default unlike Docker for Windows.

In this post, I will show you how to install Docker Compose on Windows Server 2016 and Windows Server 2016 1709.

What Is Docker Compose

Docker Compose is a JSON language tool that defines single or multiple applications using a YAML file that configures core services like Services, Volumes and Networking.

Installation

Installing docker Compose requires an internet connection and Windows PowerShell.

To install Docker Compose I will run the two lines below, The first line will configure TLS settings for Github and the second one will download Docker Compose from GitHub and copy it to C:\Program Files.

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest "https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Windows-x86_64.exe" -UseBasicParsing -OutFile $Env:ProgramFiles\docker\docker-compose.exe

Note: to change the downloaded version number visit the link below and change the number (1.21.2)

https://github.com/docker/compose/releases

The process takes around 2 minutes

Check Version

To check it was installed I will run the line below

docker-compose version

Below, I will run docker compose with a small application

Below is my YAML file

As you can see it runs without any issue


Posted

in

,

by