Can someone please help me with this , installation of docker compose on Windows 11 , with Linux

I am trying to get started with DevOps as these are basics for me to get started , I am trying to install the stand-alone docker composition , but end up having this situation ,

$ curl -SL https://github.com/docker/compose/releases/download/v2.39.4/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0Warning: Failed to open the file /usr/local/bin/docker-compose: Permission
Warning: denied
  0 72.8M    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0
curl: (23) client returned ERROR on write of 1365 bytes

I have followed this steps , but it is throwing me an error , can someone please help me with this.

It seems the user you are downloading the file with does not have permissions to write to /usr/local/bin. So this is rather a Linux permission (knowledge) issue than Docker related.

How can i fix this , where have I gone wrong

Start by learning about Linux file permissions (1, 2).

Then 1) use a user with according permissions to download the file to the folder,
or 2) add the permissions (groups) to the current user
or 3) change the folder permissions to allow the current user to write there
or 4) download the file to a different folder and later call it with full path

Either you have root access and use sudo to download or move the plugin to /usr/local/bin or read the guide in the documentation to install the plugin in your home folder.

Note: You followed the “Standalone” installation method. But you want to use Compose v2, which works as a plugin. The original path could still work, but better using the plugin method.

https://docs.docker.com/compose/install/linux/#install-the-plugin-manually

Quoting the documentation:

  1. To download and install the Docker Compose CLI plugin, run:
 DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
 mkdir -p $DOCKER_CONFIG/cli-plugins
 curl -SL https://github.com/docker/compose/releases/download/v2.40.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose

This command downloads and installs the latest release of Docker Compose for the active user under $HOME directory.To install:

  • Docker Compose for all users on your system, replace ~/.docker/cli-plugins with /usr/local/lib/docker/cli-plugins.
  • A different version of Compose, substitute v2.40.0 with the version of Compose you want to use.
  • For a different architecture, substitute x86_64 with the architecture you want.
  1. Apply executable permissions to the binary:
 chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

or, if you chose to install Compose for all users:

 sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
  1. Test the installation.
 docker compose version

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.